From a59462f1a4e342ac6dfaae541be25948053cb3ac Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 29 Dec 2006 21:18:37 +0000 Subject: [PATCH] =?UTF-8?q?MDL-7837=20auth=5Fldap=5Fbulk=5Finsert()=20fail?= =?UTF-8?q?s=20when=20user=20data=20contains=20single=20quotes=20-=20patch?= =?UTF-8?q?=20by=20I=C3=B1aki=20Arenaza;=20backported=20from=20HEAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 ccf96dfe90c..c9ec57606fc 100644 --- a/auth/ldap/lib.php +++ b/auth/ldap/lib.php @@ -713,7 +713,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";