From 98b82842d58579832f0687127218cd272a7ad636 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 12 Dec 2020 15:59:37 +0100 Subject: [PATCH] Session compatibility PHP 7.1 and older (#3273) #fix https://github.com/FreshRSS/FreshRSS/issues/3239 Reason: https://php.net/session-write-close used to return void and not boolean before PHP 7.2 --- lib/Minz/Session.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index cb0e5336e..f8ecd2f31 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -12,14 +12,16 @@ class Minz_Session { private static $locked = false; public static function lock() { - if (!self::$volatile && !self::$locked && session_start()) { + if (!self::$volatile && !self::$locked) { + session_start(); self::$locked = true; } return self::$locked; } public static function unlock() { - if (!self::$volatile && session_write_close()) { + if (!self::$volatile) { + session_write_close(); self::$locked = false; } return self::$locked;