1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 07:05:56 +00:00

stop caching schema version entirely, fix some session_start() related warnings

This commit is contained in:
Andrew Dolgov
2021-02-25 15:28:27 +03:00
parent 1464abbbfc
commit efd196839a
6 changed files with 20 additions and 20 deletions

View File

@@ -305,22 +305,14 @@
return $s ? 1 : 0;
}
// Session caching removed due to causing wrong redirects to upgrade
// script when get_schema_version() is called on an obsolete session
// created on a previous schema version.
function get_schema_version($nocache = false) {
global $schema_version;
function get_schema_version() {
$pdo = Db::pdo();
if (!$schema_version && !$nocache) {
$row = $pdo->query("SELECT schema_version FROM ttrss_version")->fetch();
$version = $row["schema_version"];
$schema_version = $version;
return $version;
} else {
return $schema_version;
}
$row = $pdo->query("SELECT schema_version FROM ttrss_version")->fetch();
$version = $row["schema_version"];
$schema_version = $version;
return $version;
}
function file_is_locked($filename) {

View File

@@ -152,6 +152,7 @@
if (!defined('NO_SESSION_AUTOSTART')) {
if (isset($_COOKIE[session_name()])) {
@session_start();
if (session_status() != PHP_SESSION_ACTIVE)
session_start();
}
}