Menu

Multi-byte safe?

Help
mx
2005-03-08
2013-04-08
  • mx

    mx - 2005-03-08

    Will kses accept and unspoil multi-byte characters that are being used,  for example, in the "title" attribute of <a>?
    Thanks. DM

     
    • Ulf Harnhammar

      Ulf Harnhammar - 2005-03-10

      I'm not sure. It doesn't do anything special to work with multi-byte characters, but it shouldn't ruin them either.

      If you have the time, perhaps you can test it with multi-byte characters and let me know?

      // Ulf

       
    • mx

      mx - 2005-10-31

      Moodle (http://moodle.org) uses kses and I found out that the line #386 (kses.php):

      $string = preg_replace('/\xad+/', '', $string); # deals with Opera "feature"

      is breaking links containing non-ascii multibyte characters (in UTF-8).

      For example, instead of
      <a title="Stolovn"  href="xxx/xyz.htm"  target="_blank">TEXT</a>

      the kses is returning bad characters in the link title, causing Mozilla browsers to display a question mark instead of the damaged characters, but causing IE to break the link completely - bad characters can still be found in the source code but the link simply disappears from the screen!

      When I comment out the line, everything is working fine.

       

Log in to post a comment.