diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index 2b18919818..36e7784bc2 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -558,6 +558,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']; @@ -566,11 +572,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); }