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
pull/3285/head
Alexandre Alapetite 4 years ago committed by GitHub
parent da4121cb6c
commit 98b82842d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      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;

Loading…
Cancel
Save