thomascube
2008-09-18 fdebae88c2c61915566d2eef910f7913c47930c8
Better detection of HTML double-encoded entities

1 files modified
2 ■■■ changed files
program/include/main.inc 2 ●●● patch | view | raw | blame | history
program/include/main.inc
@@ -347,7 +347,7 @@
      $str = strip_tags($str);
    
    // avoid douple quotation of &
    $out = preg_replace('/&([a-z]{2,5}|#[0-9]{2,4});/', '&\\1;', strtr($str, $encode_arr));
    $out = preg_replace('/&([A-Za-z]{2,6}|#[0-9]{2,4});/', '&\\1;', strtr($str, $encode_arr));
      
    return $newlines ? nl2br($out) : $out;
    }