From 8864d514c82bc29f0014e45330383ab2ee812910 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 14 Nov 2022 14:57:45 +0100 Subject: NFS-friendly is_writable() checks (#4780) #fix https://github.com/FreshRSS/FreshRSS/issues/4779 --- app/Controllers/updateController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/Controllers/updateController.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 675bd7def..f1588c7e1 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -14,7 +14,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { public static function migrateToGitEdge() { $errorMessage = 'Error during git checkout to edge branch. Please change branch manually!'; - if (!is_writable(FRESHRSS_PATH . '/.git/')) { + if (!is_writable(FRESHRSS_PATH . '/.git/config')) { throw new Exception($errorMessage); } @@ -118,7 +118,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { if ($version == '') { $version = 'unknown'; } - if (is_writable(FRESHRSS_PATH)) { + if (touch(FRESHRSS_PATH . '/index.html')) { $this->view->update_to_apply = true; $this->view->message = array( 'status' => 'good', @@ -217,7 +217,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { } public function applyAction() { - if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH) || Minz_Configuration::get('system')->disable_update) { + if (Minz_Configuration::get('system')->disable_update || !file_exists(UPDATE_FILENAME) || !touch(FRESHRSS_PATH . '/index.html')) { Minz_Request::forward(array('c' => 'update'), true); } -- cgit v1.2.3