WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] WordPress Popular Posts 2.1.3: Problem with Special Characters (6 posts)

  1. MacMacken
    Member
    Posted 3 years ago #

    WordPress Popular Posts fails to correctly encode special characters, the problem has I occured since I updated to version 2.1.3.

    Screenshot:

    http://macmacken.com/wp-content/uploads/2010/07/wpp_20100714_001.png

    Martin

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Martin,

    Please follow these instructions and let me know if it fixes the issue:

    1. Open wordpress-popular-posts.php using an editor such as Windows' Notepad or Adobe Dreamweaver.
    2. Around line 622, find and change this:
      $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');
    3. Save changes.
  3. azurial
    Member
    Posted 3 years ago #

    cheers thx ikki

  4. MacMacken
    Member
    Posted 3 years ago #

    Thank you, Ikki24, the suggested UTF-8 amendment of wordpress-popular-posts.php fixed the issue.

  5. Héctor Cabrera
    Member
    Plugin Author

    Posted 3 years ago #

    WordPress Popular Posts 2.1.4 will detect automatically the charset used on your blogs so you won't have to change it manually. Will release it within the next couple of days, so stay tuned!

  6. MacMacken
    Member
    Posted 3 years ago #

    Thanks again, I have just upgraded to version 2.1.4 and the problem is definitely no longer reproducible. Great job, thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic