summaryrefslogtreecommitdiff
path: root/app/Controllers/updateController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-06-03 15:18:04 +0200
committerGravatar GitHub <noreply@github.com> 2017-06-03 15:18:04 +0200
commitfd43ee546e419fc9fbb9a3ad974d2234d94cffaa (patch)
tree2df9fd1daf5b994d7bbde8dd46f7605e4370c268 /app/Controllers/updateController.php
parentbe0bcfef7e38f27284ec7b377b342ba389515964 (diff)
parent6f3653d430c86b026f8e007a276fdba2b09b61b3 (diff)
Merge pull request #1549 from FreshRSS/dev1.7.0
Version 1.7.0
Diffstat (limited to 'app/Controllers/updateController.php')
-rw-r--r--app/Controllers/updateController.php31
1 files changed, 17 insertions, 14 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index b4e8a0bff..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),
+ );
+ }
}
}
@@ -190,6 +192,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
if (self::isGit()) {
$res = self::gitPull();
} else {
+ require(UPDATE_FILENAME);
if (Minz_Request::isPost()) {
save_info_update();
}