diff options
| author | 2015-01-31 14:48:35 +0100 | |
|---|---|---|
| committer | 2015-01-31 14:48:35 +0100 | |
| commit | c29b6d4c226cf9c45d7d372ee4bce3bcbcca99a6 (patch) | |
| tree | 9a8f2be9185cd110988bf8a687aaa316c9145db9 /app/Controllers | |
| parent | e92acfd8227bc3ac94e9039343ff76c20facf29a (diff) | |
| parent | e91b72b63cd11ae3c4f59e48439e93955242c673 (diff) | |
Merge branch 'dev' into beta
Conflicts:
README.fr.md
README.md
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/errorController.php | 40 | ||||
| -rw-r--r-- | app/Controllers/importExportController.php | 2 | ||||
| -rw-r--r-- | app/Controllers/subscriptionController.php | 7 | ||||
| -rw-r--r-- | app/Controllers/updateController.php | 5 |
4 files changed, 30 insertions, 24 deletions
diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php index 06fa186cf..b0bafda72 100644 --- a/app/Controllers/errorController.php +++ b/app/Controllers/errorController.php @@ -9,41 +9,43 @@ class FreshRSS_error_Controller extends Minz_ActionController { * * It is called by Minz_Error::error() method. * - * Parameters are: - * - code (default: 404) - * - logs (default: array()) + * Parameters are passed by Minz_Session to have a proper url: + * - error_code (default: 404) + * - error_logs (default: array()) */ public function indexAction() { - $code_int = Minz_Request::param('code', 404); + $code_int = Minz_Session::param('error_code', 404); + $error_logs = Minz_Session::param('error_logs', array()); + Minz_Session::_param('error_code'); + Minz_Session::_param('error_logs'); + switch ($code_int) { + case 200 : + header('HTTP/1.1 200 OK'); + break; case 403: + header('HTTP/1.1 403 Forbidden'); $this->view->code = 'Error 403 - Forbidden'; - break; - case 404: - $this->view->code = 'Error 404 - Not found'; + $this->view->errorMessage = _t('feedback.access.denied'); break; case 500: + header('HTTP/1.1 500 Internal Server Error'); $this->view->code = 'Error 500 - Internal Server Error'; break; case 503: + header('HTTP/1.1 503 Service Unavailable'); $this->view->code = 'Error 503 - Service Unavailable'; break; + case 404: default: + header('HTTP/1.1 404 Not Found'); $this->view->code = 'Error 404 - Not found'; + $this->view->errorMessage = _t('feedback.access.not_found'); } - $errors = Minz_Request::param('logs', array()); - $this->view->errorMessage = trim(implode($errors)); - if ($this->view->errorMessage == '') { - switch($code_int) { - case 403: - $this->view->errorMessage = _t('feedback.access.denied'); - break; - case 404: - default: - $this->view->errorMessage = _t('feedback.access.not_found'); - break; - } + $error_message = trim(implode($error_logs)); + if ($error_message !== '') { + $this->view->errorMessage = $error_message; } Minz_View::prependTitle($this->view->code . ' ยท '); diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index db9db66a7..589777b2a 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -151,7 +151,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { private function importOpml($opml_file) { $opml_array = array(); try { - $opml_array = libopml_parse_string($opml_file); + $opml_array = libopml_parse_string($opml_file, false); } catch (LibOPML_Exception $e) { Minz_Log::warning($e->getMessage()); return true; diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 6152b7252..333565faf 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -102,13 +102,14 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { invalidateHttpCache(); - if ($feedDAO->updateFeed($id, $values)) { + $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id)); + if ($feedDAO->updateFeed($id, $values) !== false) { $this->view->feed->_category($cat); $this->view->feed->faviconPrepare(); - Minz_Request::good(_t('feedback.sub.feed.updated'), array('c' => 'subscription', 'params' => array('id' => $id))); + Minz_Request::good(_t('feedback.sub.feed.updated'), $url_redirect); } else { - Minz_Request::bad(_t('feedback.sub.error'), array('c' => 'subscription')); + Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); } } } diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 61b62773b..4797a3486 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -28,7 +28,10 @@ class FreshRSS_update_Controller extends Minz_ActionController { ); } elseif (file_exists(UPDATE_FILENAME)) { // There is an update file to apply! - $version = file_get_contents(join_path(DATA_PATH, 'last_update.txt')); + $version = @file_get_contents(join_path(DATA_PATH, 'last_update.txt')); + if (empty($version)) { + $version = 'unknown'; + } $this->view->update_to_apply = true; $this->view->message = array( 'status' => 'good', |
