extending (trunk) patch rev32909/34417 (chopped off urls when URI contains umlauts AND mbstring.func_overload is activated): using rawurlencode instead of '%' . sprintf('%02X', ); as ord() only returns the int for the first character in a given string, thus crippling multibyte chars

This commit is contained in:
Klaus Leithoff 2011-06-08 10:16:31 +00:00
parent e532c973d3
commit 0255244b30

View File

@ -52,7 +52,7 @@ class HTMLPurifier_PercentEncoder
//error_log(__METHOD__.__LINE__.$string);
for ($i = 0, $c = strlen($string); $i < $c; $i++) {
if (substr($string,$i,1) !== '%' && !isset($this->preserve[$int = ord(substr($string,$i,1))]) ) {
$ret .= '%' . sprintf('%02X', $int);
$ret .= rawurlencode(substr($string,$i,1)); // '%' . sprintf('%02X', $int);
} else {
$ret .= substr($string,$i,1);
}