From df263c22a38928ae6807a2f9c9de898d1b209030 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 4 Mar 2020 20:28:30 +0100 Subject: [PATCH] some fixes for warnings during phpUnit about session+translation --- api/src/Session.php | 2 ++ api/src/Translation.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/Session.php b/api/src/Session.php index c800446693..17dc2ec68e 100644 --- a/api/src/Session.php +++ b/api/src/Session.php @@ -1658,6 +1658,8 @@ class Session */ private static function set_cookiedomain() { + if (PHP_SAPI === "cli") return; // gives warnings and has no benefit + if ($GLOBALS['egw_info']['server']['cookiedomain']) { // Admin set domain, eg. .domain.com to allow egw.domain.com and www.domain.com diff --git a/api/src/Translation.php b/api/src/Translation.php index bc5381793a..59fa77fb23 100644 --- a/api/src/Translation.php +++ b/api/src/Translation.php @@ -395,7 +395,11 @@ class Translation static function &load_app($app,$lang) { //$start = microtime(true); - if (is_null(self::$db)) self::init(false); + if (!isset(self::$db)) + { + self::init(false); + if (!isset(self::$db)) return; + } $loaded = array(); foreach(self::$db->select(self::LANG_TABLE,'message_id,content',array( 'lang' => $lang,