]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-4248 Fix error when updating user profiles and any of these fields is empty
authoriarenaza <iarenaza>
Sat, 31 May 2008 15:00:42 +0000 (15:00 +0000)
committeriarenaza <iarenaza>
Sat, 31 May 2008 15:00:42 +0000 (15:00 +0000)
According to http://es2.php.net/manual/en/function.ldap-modify.php#43216 we
need to specify an array() value to delete an attribute's value, instead of an
empty string.

Merged from MOODLE_18_STABLE

auth/ldap/auth.php

index 73c38a89549e5695289434bc46254f73cfb0dcbc..a47b7162627c3010ffd8b33739618994de9580bf 100644 (file)
@@ -1099,6 +1099,7 @@ error('fix temporary table code in CAS');
                     }
 
                     $nuvalue = $textlib->convert($newuser->$key, 'utf-8', $this->config->ldapencoding);
+                    empty($nuvalue) ? $nuvalue = array() : $nuvalue;
                     $ouvalue = $textlib->convert($olduser->$key, 'utf-8', $this->config->ldapencoding);
 
                     foreach ($ldapkeys as $ldapkey) {