fixed 5.4 PHP Warning: Illegal offset type

This commit is contained in:
Ralf Becker 2012-07-17 13:59:56 +00:00
parent c30f5d442c
commit 54a2a21a4f

View File

@ -527,6 +527,12 @@ class accounts
*/
function name2id($name,$which='account_lid',$account_type=null)
{
// Don't bother searching for empty or non-scalar account_lid
if(empty($name) || !is_scalar($name))
{
return False;
}
self::setup_cache();
$name_list = &self::$cache['name_list'];
@ -535,11 +541,6 @@ class accounts
return $name_list[$which][$name];
}
// Don't bother searching for empty account_lid
if(empty($name))
{
return False;
}
return $name_list[$which][$name] = $this->backend->name2id($name,$which,$account_type);
}