diff options
Diffstat (limited to 'app/Controllers/updateController.php')
| -rw-r--r-- | app/Controllers/updateController.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 675bd7def..f638ce96c 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); } @@ -23,7 +23,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { if ($return != 0) { throw new Exception($errorMessage); } - $line = is_array($output) ? implode('', $output) : $output; + $line = implode('', $output); if ($line !== 'master' && $line !== 'dev') { return true; // not on master or dev, nothing to do } @@ -54,14 +54,14 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { $output = []; exec('git status -sb --porcelain remote', $output, $return); } else { - $line = is_array($output) ? implode('; ', $output) : $output; + $line = implode('; ', $output); Minz_Log::warning('git fetch warning: ' . $line); } } catch (Exception $e) { Minz_Log::warning('git fetch error: ' . $e->getMessage()); } chdir($cwd); - $line = is_array($output) ? implode('; ', $output) : $output; + $line = implode('; ', $output); return $line == '' || strpos($line, '[behind') !== false || strpos($line, '[ahead') !== false || strpos($line, '[gone') !== false; } @@ -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 (FreshRSS_Context::$system_conf->disable_update || !file_exists(UPDATE_FILENAME) || !touch(FRESHRSS_PATH . '/index.html')) { Minz_Request::forward(array('c' => 'update'), true); } |
