From 858616f075e5a66a5e0973af421a9f300b3b9ce1 Mon Sep 17 00:00:00 2001 From: Inverle Date: Fri, 5 Sep 2025 08:16:52 +0200 Subject: Fixes for no-cache.txt (#7907) * Closes and fixes error from #7885 * `no-cache.txt` is now respected in `f.php`, `ext.php` and `serve` action in `extensionController` * And in all other places that weren't checking for `no-cache.txt` (some extensions maybe) --- p/i/index.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'p/i') diff --git a/p/i/index.php b/p/i/index.php index 96c8e52fb..55846b952 100644 --- a/p/i/index.php +++ b/p/i/index.php @@ -35,17 +35,16 @@ if (!file_exists($applied_migrations_path)) { Minz_Session::init('FreshRSS'); Minz_Session::_param('keepAlive', 1); //To prevent the PHP session from expiring - if (!file_exists(DATA_PATH . '/no-cache.txt')) { - require(LIB_PATH . '/http-conditional.php'); - $currentUser = Minz_User::name(); - $dateLastModification = $currentUser === null ? time() : max( - FreshRSS_UserDAO::ctime($currentUser), - FreshRSS_UserDAO::mtime($currentUser), - @filemtime(DATA_PATH . '/config.php') ?: 0 - ); - if (httpConditional($dateLastModification ?: time(), 0, 0, false, PHP_COMPRESSION, true)) { - exit(); //No need to send anything - } + require(LIB_PATH . '/http-conditional.php'); + $currentUser = Minz_User::name(); + $dateLastModification = $currentUser === null ? time() : max( + FreshRSS_UserDAO::ctime($currentUser), + FreshRSS_UserDAO::mtime($currentUser), + @filemtime(DATA_PATH . '/config.php') ?: 0 + ); + if (!file_exists(DATA_PATH . '/no-cache.txt') + && httpConditional($dateLastModification ?: time(), 0, 0, false, PHP_COMPRESSION, true)) { + exit(); //No need to send anything } $error = false; -- cgit v1.2.3