From 48ccfa42d39836fb3fdcd212a7d71a08b65f6c41 Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@owncloud.com>
Date: Wed, 6 Jun 2012 12:29:48 +0200
Subject: [PATCH] LDPA: don't drop legal whitespaces when sanitizing DN. Fixes
 oc-914

---
 apps/user_ldap/lib_ldap.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index b900a67ec3..f6942ad326 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);
-- 
GitLab