From 123b46372b457f7dd668dc6bd81861d2ac14da6d Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 8 Jun 2011 09:55:26 +0000 Subject: [PATCH] extending 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 --- .../inc/htmlpurifier/library/HTMLPurifier/PercentEncoder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/PercentEncoder.php b/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/PercentEncoder.php index 93de935a7d..164b9bd83d 100755 --- a/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/PercentEncoder.php +++ b/phpgwapi/inc/htmlpurifier/library/HTMLPurifier/PercentEncoder.php @@ -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); }