summaryrefslogtreecommitdiff
path: root/debian/patches/add_phpbb_prefix_to_ldap_escape.patch
blob: 51abc2d269ff17768d24730fbd31f6fddbbaa757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 <jakubsenko@gmail.com>
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 <bantu@phpbb.com>
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);
 }