Description: Add phpbb_ prefix to ldap_escape() Since ldap_escape() has been added to PHP 5.6.0+, it’s internal declaration throws a fatal error: Cannot redeclare ldap_escape() at line 300 in /includes/auth/auth_ldap.php Author: Jakub Senko Origin: upstream Bug: https://tracker.phpbb.com/browse/PHPBB3-12468 https://tracker.phpbb.com/browse/PHPBB3-13168 Bug-Debian: https://bugs.debian.org/778553 Applied-Upstream: commit, https://github.com/phpbb/phpbb/commit/ba464ec93a2707b602d212e364905a920b3b9460 Reviewed-by: Andreas Fischer Last-Update: 2015-02-16 --- a/includes/auth/auth_ldap.php +++ b/includes/auth/auth_ldap.php @@ -282,7 +282,7 @@ { global $config; - $filter = '(' . $config['ldap_uid'] . '=' . ldap_escape(htmlspecialchars_decode($username)) . ')'; + $filter = '(' . $config['ldap_uid'] . '=' . phpbb_ldap_escape(htmlspecialchars_decode($username)) . ')'; if ($config['ldap_user_filter']) { $_filter = ($config['ldap_user_filter'][0] == '(' && substr($config['ldap_user_filter'], -1) == ')') ? $config['ldap_user_filter'] : "({$config['ldap_user_filter']})"; @@ -294,7 +294,7 @@ /** * Escapes an LDAP AttributeValue */ -function ldap_escape($string) +function phpbb_ldap_escape($string) { return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string); }