all character become "��大�(�)"....
all character become "��大�(�)"....
I use Japanese character.
I updated WPP to 2.1.3 from 2.1.0, and my widget is garbled, too.
It works properly with 2.1.0.
I replaced $instance['title'] = htmlspecialchars( stripslashes(strip_tags( $new_instance['title'] )), ENT_QUOTES ); with $instance['title'] = htmlspecialchars( stripslashes(strip_tags( $new_instance['title'] )), ENT_QUOTES, 'UTF-8', FALSE );, but a problem was not settled.
Same here for Russian language, instead of the post titles in Russian i get the same thing as yanc1985. The last proper working version was 2.1.0. I know for sure that the problem is somewhere in wordpress-popular-posts.php, but i can't find it. Great plugin though, thanks
Thanks Kirijun!
After I read the Changelog for that Plugin I found the following comment in version 2.1.1: "Added htmlentities to post titles".
So the solution for correct implementation of htmlentities in WP is to give it the used charset, too (like Kirijun wrote).
htmlentities is used two times in wordpress-popular-posts.php (v2.1.3): line 624 and line 630.
The best way would be:
$bcharset = get_bloginfo('charset');$title_attr = htmlentities($tit, ENT_QUOTES, $bcharset, FALSE);$tit = htmlentities($tit, ENT_QUOTES, $bcharset, FALSE);@Héctor Cabrera (the Plugin Author):
Please fix that ASAP! - Thanks!
sofar|sokai
Hi guys,
Please try this fix and let me know the results:
$tit = stripslashes($tit);
$title_attr = htmlentities($tit, ENT_QUOTES);
if ( $instance['shorten_title']['active'] && (strlen($tit) > $instance['shorten_title']['length'])) {
$tit = mb_substr($tit, 0, $instance['shorten_title']['length'], 'UTF-8') . "...";
}
$tit = htmlentities($tit, ENT_QUOTES);
... into this:
$tit = stripslashes($tit);
$title_attr = htmlentities($tit, ENT_QUOTES, 'UTF-8');
if ( $instance['shorten_title']['active'] && (strlen($tit) > $instance['shorten_title']['length'])) {
$tit = mb_substr($tit, 0, $instance['shorten_title']['length'], 'UTF-8') . "...";
}
$tit = htmlentities($tit, ENT_QUOTES, 'UTF-8');
P.S.: Sokai's proposal seems a bit better. Will test this and post back later with new instructions.
OK guys, please download 2.1.4 here and let me know if it fixes the issue.
I downloaded 2.1.4 and it works correctly. Thank you!
Good to know that, Kirijun! Thanks for reporting!
Hi Ikki24.
Thank you for fast reply.
But there is still a little bug.
It shows backslash like this in source code.
<span class=\"wpp-post-title\">
Hi mono-lab,
Can you please post a screenshot of your WPP widget settings?
Ok plese take a look in here.
Thanks! Found the bug and fixed it, please download WPP 2.1.4 here and let me know if the issue is fixed.
Latest 2.1.4 works fine for me with the german characters now. Thank you ikki24
Thank you Ikki24.
It works fine now!
Thanks for the quick reply and improvement :)
Thank you guys for your continuous feedback and suggestions!
Yes, it's fixed. Thanks a lot
This topic has been closed to new replies.