]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDPA: don't drop legal whitespaces when sanitizing DN. Fixes oc-914
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 6 Jun 2012 10:29:48 +0000 (12:29 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 6 Jun 2012 10:29:48 +0000 (12:29 +0200)
apps/user_ldap/lib_ldap.php

index b900a67ec312d14940c4c480d93d4ce64f641810..f6942ad326e35c31095e1db6cf745166653c149b 100644 (file)
@@ -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);