fixed 5.4 PHP Warning: Illegal offset type

This commit is contained in:
Ralf Becker 2012-07-17 13:59:37 +00:00
parent 565a2be7d6
commit 493bf3bcd0

View File

@ -558,6 +558,12 @@ class accounts
*/ */
function name2id($name,$which='account_lid',$account_type=null) 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(); self::setup_cache();
$name_list = &self::$cache['name_list']; $name_list = &self::$cache['name_list'];
@ -566,11 +572,6 @@ class accounts
return $name_list[$which][$name]; 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); return $name_list[$which][$name] = $this->backend->name2id($name,$which,$account_type);
} }