Jul 1 2008

How to work around the Warning: cannot yet handle MBCS in html_entity_decode()! error with WP-Postviews

If you're new here, you may want to start with my most popular posts. Then, subscribe to my RSS feed to stay updated. Thanks for visiting!

Searchmarked.com Tip

I don’t remember exactly where I found this little hack or I would have put the usual google query with a link to the source in this post. So whoever you are out there, thank you. I love the WP-Postviews plugin, but I found out after some Googling that it does not work with PHP 4 (only PHP 5). You will get the following error:

MBCS in html_entity_decode()!

Fortunately, if your site uses utf-8 encoding you can use the following one line hack to work around the PHP 4 incompatibility.

Make sure you make a backup of your wp-postviews.php file before you edit it.

-Open up wp-postviews.php in your favorite text editor.

-Look for the following line:

$text = html_entity_decode($text, ENT_QUOTES, get_option('blog_charset'));

-Replace the line with the following:

$text = utf8_decode($text);

That’s it! WP-Postviews should work perfectly now. It did for me at least ;) . Thanks for the awesome plugin Lester!

Technorati Tags: , , ,

Related posts:

  1. How to create a popular posts page with the wp-postviews plugin
  2. How to fix the Fatal error: Call to undefined function the_content_limit() in the Wordpress Revolution Theme

5 Comments on this post

Trackbacks

  1. GaMerZ said:

    Thanks for the compliments =D

    July 2nd, 2008 at 2:18 am
  2. hstagner said:

    You are welcome! Thanks for stopping by and thanks for creating the awesome plugin.

    Regards,

    Harley Stagner

    July 2nd, 2008 at 2:53 am
  3. V said:

    This post was extremely helpful.

    Congratulations for your great blog!

    ;)

    .-

    September 7th, 2008 at 3:51 pm
  4. Tacky News said:

    Thanks for this it fixed my problem! Host must still be using PHP4.

    September 19th, 2008 at 4:19 pm
  5. Metin said:

    I cant find solution anywhere but this is perfect :) thanks thanks thanks…

    September 24th, 2008 at 6:11 pm

LEAVE A COMMENT

Subscribe Form

Subscribe to Blog

Sponsors

Recent Readers

JOIN MY COMMUNITY!
                 
                  Computers Blogs - Blog Top Sites