From cf6bf1ab5f77cb92feff50f4dccfe1e70a22a3fb Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 29 Dec 2006 21:17:43 +0000 Subject: [PATCH] =?utf8?q?MDL-7837=20auth=5Fldap=5Fbulk=5Finsert()=20fails?= =?utf8?q?=20when=20user=20data=20contains=20single=20quotes=20-=20patch?= =?utf8?q?=20by=20I=C3=B1aki=20Arenaza?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- auth/ldap/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/ldap/lib.php b/auth/ldap/lib.php index 88947eda9b..3d1e72eecb 100644 --- a/auth/ldap/lib.php +++ b/auth/ldap/lib.php @@ -703,7 +703,7 @@ function auth_ldap_bulk_insert($users){ // bulk insert -- superfast with $bulk_insert_records $sql = 'INSERT INTO '.$CFG->prefix.'extuser (idnumber) VALUES '; // make those values safe - array_map('addslashes', $users); + $users = array_map('addslashes', $users); // join and quote the whole lot $sql = $sql . '(\'' . join('\'),(\'', $users) . '\')'; print "+ " . count($users) . " users\n"; -- 2.39.5