diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index 7956a872ec..c031c0036f 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -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); }