From: Jeffery To Date: Mon, 8 Mar 2010 07:31:16 +0000 (+0800) Subject: Fixed warning messages when auto-registering a new LDAP user. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ef3991dbbe0acdba2dd7050b99f951ccfe5b8258;p=quix0rs-gnu-social.git Fixed warning messages when auto-registering a new LDAP user. On my test system (without memcache), while testing the LDAP authentication plugin, when I sign in for the first time, triggering auto-registration, I get these messages in the output page: Warning: ksort() expects parameter 1 to be array, null given in /home/jeff/Documents/code/statusnet/classes/Memcached_DataObject.php on line 219 Warning: Invalid argument supplied for foreach() in /home/jeff/Documents/code/statusnet/classes/Memcached_DataObject.php on line 224 Warning: assert() [function.assert]: Assertion failed in /home/jeff/Documents/code/statusnet/classes/Memcached_DataObject.php on line 241 (plus two "Cannot modify header information..." messages as a result of the above warnings) This change appears to fix this (although I can't really explain exactly why). --- diff --git a/classes/User_username.php b/classes/User_username.php index 853fd5cb86..8d99cddd3f 100644 --- a/classes/User_username.php +++ b/classes/User_username.php @@ -55,7 +55,7 @@ class User_username extends Memcached_DataObject // now define the keys. function keys() { - return array('provider_name', 'username'); + return array('provider_name' => 'K', 'username' => 'K'); } }