From 8c69891072ed2def836f67d7f112bf5f86e9fb36 Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Wed, 18 Dec 2019 14:08:58 -0600
Subject: [PATCH] session: Destroy Warning

This addresses the `session_destroy()` warning many people are receiving
with PHP 7+. The warning states `PHP Warning:  session_destroy(): Session
callback expects true/false return value`. This is because our session
destroy method does not always return true/false, sometimes it returns
`int(1)`. This adds a check to see if the session was not deleted
successfully, if not it returns false, otherwise it returns true. This will
ensure `session_destroy()` always receives a true/false return value.
---
 include/class.ostsession.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class.ostsession.php b/include/class.ostsession.php
index 55c124932..303b9d1c5 100644
--- a/include/class.ostsession.php
+++ b/include/class.ostsession.php
@@ -228,7 +228,7 @@ extends SessionBackend {
     }
 
     function destroy($id){
-        return SessionData::objects()->filter(['session_id' => $id])->delete();
+        return (SessionData::objects()->filter(['session_id' => $id])->delete());
     }
 
     function cleanup() {
-- 
GitLab