phpBB

Code Changes

File: includes/auth/auth_ldap.php

  Unmodified   Added   Modified   Removed
Line 282Line 282
{
global $config;


{
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']})";

	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']})";

Line 294Line 294
/**
* Escapes an LDAP AttributeValue
*/

/**
* Escapes an LDAP AttributeValue
*/

function ldap_escape($string)

function phpbb_ldap_escape($string)

{
return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
}

{
return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
}