From: Christian Weiske Date: Fri, 11 Aug 2017 19:55:57 +0000 (+0200) Subject: Replace preg_replace('//e') with preg_replace_callback X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F15%2Fhead;p=contagged Replace preg_replace('//e') with preg_replace_callback Can be tested with the "*" filter --- diff --git a/inc/functions.php b/inc/functions.php index cb75190..db8c6b0 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -357,9 +357,13 @@ function ldap_store_objectclasses($dn,$classes){ * @author Andreas Gohr */ function ldap_filterescape($string){ - return preg_replace('/([\x00-\x1F\*\(\)\\\\])/e', - '"\\\\\".join("",unpack("H2","$1"))', - $string); + return preg_replace_callback( + '/([\x00-\x1F\*\(\)\\\\])/', + function ($matches) { + return "\\" . implode("", unpack("H2", $matches[1])); + }, + $string + ); } /**