From 276c00641cd20860521075e44e2e3789c8d9fa6b Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 11 Aug 2017 21:55:57 +0200 Subject: [PATCH] Replace preg_replace('//e') with preg_replace_callback Can be tested with the "*" filter --- inc/functions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 + ); } /** -- 2.39.5