From: Arthur Schiwon Date: Wed, 6 Jun 2012 10:29:48 +0000 (+0200) Subject: LDPA: don't drop legal whitespaces when sanitizing DN. Fixes oc-914 X-Git-Tag: v4.5.0beta1~74^2~423^2~36 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=190fca1121d4b37d7c4b2f96204daf7d8d0dded6;p=nextcloud-server.git LDPA: don't drop legal whitespaces when sanitizing DN. Fixes oc-914 --- diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php index b900a67ec31..f6942ad326e 100644 --- a/apps/user_ldap/lib_ldap.php +++ b/apps/user_ldap/lib_ldap.php @@ -530,7 +530,7 @@ class OC_LDAP { static private function sanitizeDN($dn) { //OID sometimes gives back DNs with whitespace after the comma a la "uid=foo, cn=bar, dn=..." We need to tackle this! - $dn = preg_replace('/,\s+/',',',$dn); + $dn = preg_replace('/([^\\\]),(\s+)/','\1,',$dn); //make comparisons and everything work $dn = strtolower($dn);