mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:04:53 +01:00
no need to run expensive mb_substr 3 times
This commit is contained in:
parent
123b46372b
commit
c66928875a
@ -51,8 +51,8 @@ class HTMLPurifier_PercentEncoder
|
||||
$ret = '';
|
||||
//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 .= rawurlencode(substr($string,$i,1)); // '%' . sprintf('%02X', $int);
|
||||
if (($chr=substr($string,$i,1)) !== '%' && !isset($this->preserve[$int = ord($chr)])) {
|
||||
$ret .= rawurlencode($chr); // '%' . sprintf('%02X', $int);
|
||||
} else {
|
||||
$ret .= substr($string,$i,1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user