From c3f1e887c52e6665426885ae06e04947853326b8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 24 Aug 2016 19:43:01 +0200 Subject: [PATCH] no need to call accounts class, if we have no id --- api/src/Accounts.php | 2 +- api/src/loader/common.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; }