diff --git a/api/src/Accounts.php b/api/src/Accounts.php index 119238ebcd..7669fc4bce 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -786,7 +786,7 @@ class Accounts */ function exists($account_id) { - if (!($data = $this->read($account_id))) + if (!$account_id || !($data = $this->read($account_id))) { return 0; } diff --git a/api/src/loader/common.php b/api/src/loader/common.php index 00f4ad7a74..50ce739b46 100755 --- a/api/src/loader/common.php +++ b/api/src/loader/common.php @@ -304,7 +304,7 @@ function get_account_id($account_id = '',$default_id = '') } elseif (is_string($account_id)) { - if($GLOBALS['egw']->accounts->exists((int)$account_id) == True) + if((int)$account_id && $GLOBALS['egw']->accounts->exists((int)$account_id) == True) { return (int)$account_id; }