From 7795c415ab50bbf6af46e615bb74a6c6d5e41d0b Mon Sep 17 00:00:00 2001 From: Rodney Stromlund Date: Wed, 29 Mar 2023 08:20:52 -0500 Subject: [PATCH 1/2] isLoggedIn adds a message to the system log when it returns false, fix for php8+ --- classes/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/api.php b/classes/api.php index b482a70eb..bee1ff509 100755 --- a/classes/api.php +++ b/classes/api.php @@ -99,7 +99,7 @@ class API extends Handler { } function isLoggedIn(): bool { - return $this->_wrap(self::STATUS_OK, array("status" => $_SESSION["uid"] != '')); + return $this->_wrap(self::STATUS_OK, array("status" => ($_SESSION["uid"] ?? '') != '')); } function getUnread(): bool { From 80bd26b3b10c6aef37054948db2701fdbd9985e4 Mon Sep 17 00:00:00 2001 From: Rodney Stromlund Date: Fri, 31 Mar 2023 20:26:36 -0500 Subject: [PATCH 2/2] isLoggedIn adds a message to the system log when it returns false, fix for php8+, removed empty test for bool conversion. --- classes/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/api.php b/classes/api.php index bee1ff509..255de52d4 100755 --- a/classes/api.php +++ b/classes/api.php @@ -99,7 +99,7 @@ class API extends Handler { } function isLoggedIn(): bool { - return $this->_wrap(self::STATUS_OK, array("status" => ($_SESSION["uid"] ?? '') != '')); + return $this->_wrap(self::STATUS_OK, array("status" => (bool)($_SESSION["uid"] ?? ''))); } function getUnread(): bool {