diff options
| author | 2017-05-25 14:27:31 +0200 | |
|---|---|---|
| committer | 2017-05-25 14:27:31 +0200 | |
| commit | 20d1301b462378376ab83bcae56c9065b241e4a5 (patch) | |
| tree | 04a09b6b4c904c8e8ae9764f75cd7d681d0ddf82 /app/Controllers/updateController.php | |
| parent | 21954d6d83b94bd9ad4d763fb237710e71f14de1 (diff) | |
Do not require write access to check new version
Do not require write access to check if new ZIP version is available
https://github.com/FreshRSS/FreshRSS/issues/1450
Diffstat (limited to 'app/Controllers/updateController.php')
| -rw-r--r-- | app/Controllers/updateController.php | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 35c7d1124..7a8a3d6c0 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -59,24 +59,26 @@ class FreshRSS_update_Controller extends Minz_ActionController { public function indexAction() { Minz_View::prependTitle(_t('admin.update.title') . ' ยท '); - if (!is_writable(FRESHRSS_PATH)) { - $this->view->message = array( - 'status' => 'bad', - 'title' => _t('gen.short.damn'), - 'body' => _t('feedback.update.file_is_nok', FRESHRSS_PATH) - ); - } elseif (file_exists(UPDATE_FILENAME)) { + if (file_exists(UPDATE_FILENAME)) { // There is an update file to apply! $version = @file_get_contents(join_path(DATA_PATH, 'last_update.txt')); - if (empty($version)) { + if ($version == '') { $version = 'unknown'; } - $this->view->update_to_apply = true; - $this->view->message = array( - 'status' => 'good', - 'title' => _t('gen.short.ok'), - 'body' => _t('feedback.update.can_apply', $version) - ); + if (is_writable(FRESHRSS_PATH)) { + $this->view->update_to_apply = true; + $this->view->message = array( + 'status' => 'good', + 'title' => _t('gen.short.ok'), + 'body' => _t('feedback.update.can_apply', $version), + ); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.file_is_nok', $version, FRESHRSS_PATH), + ); + } } } |
