From: iarenaza Date: Sat, 31 May 2008 15:00:42 +0000 (+0000) Subject: MDL-4248 Fix error when updating user profiles and any of these fields is empty X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=15f80fd88704fb52abb820e2651c2eeaf1805df9;p=moodle.git MDL-4248 Fix error when updating user profiles and any of these fields is empty 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 --- diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 73c38a8954..a47b716262 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -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) {