From 9483c6cf6759364678ca37d3f8379d35c72a8675 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 16 Jan 2015 23:20:59 +0100 Subject: Fix bug if a shortcut is not in the initial config A new shortcut was never saved because ConfigurationSetter never set a shortcut which did not appear in the initial conf. --- app/Models/ConfigurationSetter.php | 4 +--- app/views/configure/shortcut.phtml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index f1c465c7c..e808630b4 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -154,9 +154,7 @@ class FreshRSS_ConfigurationSetter { private function _shortcuts(&$data, $values) { foreach ($values as $key => $value) { - if (isset($data['shortcuts'][$key])) { - $data['shortcuts'][$key] = $value; - } + $data['shortcuts'][$key] = $value; } } diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index fdbeed3ea..f68091af9 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -114,7 +114,7 @@
- +
-- cgit v1.2.3 From f3d74b59e8957dfa7793125aaf71f47e088008d4 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 16 Jan 2015 23:26:29 +0100 Subject: Fix a bug when default view is the global one. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If default view is "global", the popup tried to get articles on the default view which was… "global"! Articles are present on the "normal" view instead. --- app/views/index/global.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index cf95bd0f5..0ffa3bc54 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -13,7 +13,7 @@ 'index', - 'a' => 'index', + 'a' => 'normal', 'params' => Minz_Request::params() ); -- cgit v1.2.3 From 409e09f68516be23f564be81f82f3a8af10a0bbf Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 16 Jan 2015 23:38:12 +0100 Subject: Simplify shortcut setter --- app/Models/ConfigurationSetter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index e808630b4..7fd0836c1 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -153,9 +153,11 @@ class FreshRSS_ConfigurationSetter { } private function _shortcuts(&$data, $values) { - foreach ($values as $key => $value) { - $data['shortcuts'][$key] = $value; + if (!is_array($values)) { + return; } + + $data['shortcuts'] = $values; } private function _sort_order(&$data, $value) { -- cgit v1.2.3 From fa2254cd313f538d74850a67bc062f24626d009d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 17 Jan 2015 23:07:57 +0100 Subject: Fix i18n string for errors in feed management See https://github.com/FreshRSS/FreshRSS/issues/755 --- app/Controllers/subscriptionController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 6152b7252..e98b1f640 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -108,7 +108,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { Minz_Request::good(_t('feedback.sub.feed.updated'), array('c' => 'subscription', 'params' => array('id' => $id))); } else { - Minz_Request::bad(_t('feedback.sub.error'), array('c' => 'subscription')); + Minz_Request::bad(_t('feedback.sub.feed.error'), array('c' => 'subscription')); } } } -- cgit v1.2.3 From d91a92434f516a9e25bf0dca608a0221094d0489 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 11:47:16 +0100 Subject: Fix Minz_Error and error_Controller - Error code and logs was not propagated from Minz_Error to the controller - header was bad (200 instead of 404 or 403) Related to https://github.com/FreshRSS/FreshRSS/issues/751 --- app/Controllers/errorController.php | 40 +++++++++++++++++++------------------ lib/Minz/Error.php | 39 +++++------------------------------- 2 files changed, 26 insertions(+), 53 deletions(-) (limited to 'app') 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/lib/Minz/Error.php b/lib/Minz/Error.php index 3eadc6d98..3e4a3e8f3 100644 --- a/lib/Minz/Error.php +++ b/lib/Minz/Error.php @@ -23,42 +23,13 @@ class Minz_Error { $logs = self::processLogs ($logs); $error_filename = APP_PATH . '/Controllers/errorController.php'; - switch ($code) { - case 200 : - header('HTTP/1.1 200 OK'); - break; - case 403 : - header('HTTP/1.1 403 Forbidden'); - break; - case 404 : - header('HTTP/1.1 404 Not Found'); - break; - case 500 : - header('HTTP/1.1 500 Internal Server Error'); - break; - case 503 : - header('HTTP/1.1 503 Service Unavailable'); - break; - default : - header('HTTP/1.1 500 Internal Server Error'); - } - if (file_exists ($error_filename)) { - $params = array ( - 'code' => $code, - 'logs' => $logs - ); + Minz_Session::_param('error_code', $code); + Minz_Session::_param('error_logs', $logs); - if ($redirect) { - Minz_Request::forward (array ( - 'c' => 'error' - ), true); - } else { - Minz_Request::forward (array ( - 'c' => 'error', - 'params' => $params - ), false); - } + Minz_Request::forward (array ( + 'c' => 'error' + ), $redirect); } else { echo '

An error occured

' . "\n"; -- cgit v1.2.3 From 14206aca160355507ae50e6337c798733e730c15 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 11:59:03 +0100 Subject: Improve behavior when mark as read / favorite fail If the request fails: - Open a notification to inform user - Remove pending index from the pending_feeds list Fix https://github.com/FreshRSS/FreshRSS/issues/751 --- app/i18n/en/gen.php | 3 +++ app/i18n/fr/gen.php | 3 +++ app/views/helpers/javascript_vars.phtml | 1 + p/scripts/main.js | 6 ++++++ 4 files changed, 13 insertions(+) (limited to 'app') diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index 6271717d4..539feaf40 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -95,6 +95,9 @@ return array( 'category_empty' => 'Empty category', 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', + 'feedback' => array( + 'request_failed' => 'A problem happened and the request failed.' + ), 'new_article' => 'There are new available articles, click to refresh the page.', 'notif_body_new_articles' => 'There are \\d new articles to read on FreshRSS.', 'notif_title_new_articles' => 'FreshRSS: new articles!', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 6b449484f..05ff9c38d 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -95,6 +95,9 @@ return array( 'category_empty' => 'Catégorie vide', 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', + 'feedback' => array( + 'request_failed' => 'Un problème est survenu et la requête a échoué.' + ), 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.', 'notif_body_new_articles' => 'Il y a \\d nouveaux articles à lire sur FreshRSS.', 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index fec3a6f7c..1fef13b52 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -62,6 +62,7 @@ echo 'i18n={', 'confirmation_default:"', _t('gen.js.confirm_action'), '",', 'notif_title_articles:"', _t('gen.js.notif_title_new_articles'), '",', 'notif_body_articles:"', _t('gen.js.notif_body_new_articles'), '",', + 'notif_request_failed:"', _t('gen.js.feedback.request_failed'), '",', 'category_empty:"', _t('gen.js.category_empty'), '"', "},\n"; diff --git a/p/scripts/main.js b/p/scripts/main.js index 9b6524b01..0561097e5 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -154,6 +154,9 @@ function mark_read(active, only_not_read) { incUnreadsFeed(active, feed_id, inc); faviconNbUnread(); + pending_feeds.splice(index_pending, 1); + }).fail(function (data) { + openNotification(i18n.notif_request_failed, 'bad'); pending_feeds.splice(index_pending, 1); }); } @@ -209,6 +212,9 @@ function mark_favorite(active) { } } + pending_feeds.splice(index_pending, 1); + }).fail(function (data) { + openNotification(i18n.notif_request_failed, 'bad'); pending_feeds.splice(index_pending, 1); }); } -- cgit v1.2.3 From bf2f7176ee639ab42e929e7331939da5258165c5 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 12:06:40 +0100 Subject: Improve i18n for JavaScript notif_* messages have been moved into feedback array. --- app/i18n/en/gen.php | 6 +++--- app/i18n/fr/gen.php | 6 +++--- app/views/helpers/javascript_vars.phtml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index 539feaf40..4e9e2e7d6 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -96,11 +96,11 @@ return array( 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', 'feedback' => array( - 'request_failed' => 'A problem happened and the request failed.' + 'body_new_articles' => 'There are \\d new articles to read on FreshRSS.', + 'request_failed' => 'A problem happened and the request failed.', + 'title_new_articles' => 'FreshRSS: new articles!', ), 'new_article' => 'There are new available articles, click to refresh the page.', - 'notif_body_new_articles' => 'There are \\d new articles to read on FreshRSS.', - 'notif_title_new_articles' => 'FreshRSS: new articles!', 'should_be_activated' => 'JavaScript must be enabled', ), 'lang' => array( diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 05ff9c38d..10b2c8d28 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -96,11 +96,11 @@ return array( 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', 'feedback' => array( - 'request_failed' => 'Un problème est survenu et la requête a échoué.' + 'body_new_articles' => 'Il y a \\d nouveaux articles à lire sur FreshRSS.', + 'request_failed' => 'Un problème est survenu et la requête a échoué.', + 'title_new_articles' => 'FreshRSS : nouveaux articles !', ), 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.', - 'notif_body_new_articles' => 'Il y a \\d nouveaux articles à lire sur FreshRSS.', - 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', 'should_be_activated' => 'Le JavaScript doit être activé.', ), 'lang' => array( diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 1fef13b52..613521f0f 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -60,8 +60,8 @@ echo 'url={', echo 'i18n={', 'confirmation_default:"', _t('gen.js.confirm_action'), '",', - 'notif_title_articles:"', _t('gen.js.notif_title_new_articles'), '",', - 'notif_body_articles:"', _t('gen.js.notif_body_new_articles'), '",', + 'notif_title_articles:"', _t('gen.js.feedback.title_new_articles'), '",', + 'notif_body_articles:"', _t('gen.js.feedback.body_new_articles'), '",', 'notif_request_failed:"', _t('gen.js.feedback.request_failed'), '",', 'category_empty:"', _t('gen.js.category_empty'), '"', "},\n"; -- cgit v1.2.3 From 517d5aa9c52694b21f66d429085348d2e4fd10d2 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 12:49:49 +0100 Subject: Fix feed update with MySQL/MariaDB - updateFeed() returns 0 if nothing changes so the test was false. - Redirection in case of error is better now by redirecting on the right feed Fix https://github.com/FreshRSS/FreshRSS/issues/755 --- app/Controllers/subscriptionController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index e98b1f640..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.feed.error'), array('c' => 'subscription')); + Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); } } } -- cgit v1.2.3 From 711ef5546cd218f81595e6e3b479b929ffeb3bc7 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 13:04:08 +0100 Subject: Fix mark_when setter mark_when was not taken in consideration. --- app/Models/ConfigurationSetter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app') diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index 7fd0836c1..eeb1f2f4c 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -210,9 +210,7 @@ class FreshRSS_ConfigurationSetter { private function _mark_when(&$data, $values) { foreach ($values as $key => $value) { - if (isset($data['mark_when'][$key])) { - $data['mark_when'][$key] = $this->handleBool($value); - } + $data['mark_when'][$key] = $this->handleBool($value); } } -- cgit v1.2.3 From d30b3becfa50b96982a3b4880c07cc2b770d7eed Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 19 Jan 2015 13:54:57 +0100 Subject: Addressed warnings when reading from new files There were warnings when reading extensions (trying to use e.g. README and .gitignore as directories), and when reading update file. https://github.com/FreshRSS/FreshRSS/issues/733 --- app/Controllers/updateController.php | 5 ++++- lib/Minz/ExtensionManager.php | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'app') 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', diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index 7edc7afaa..f00453f6c 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -56,6 +56,9 @@ class Minz_ExtensionManager { foreach ($list_potential_extensions as $ext_dir) { $ext_pathname = EXTENSIONS_PATH . '/' . $ext_dir; + if (!is_dir($ext_pathname)) { + continue; + } $metadata_filename = $ext_pathname . '/' . self::$ext_metaname; // Try to load metadata file. -- cgit v1.2.3 From 2036b9aed32c5446c31578ad5ff63b2a7a02bbc2 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 20 Jan 2015 19:54:00 +0100 Subject: Suppress possible warnings after update Prevent JavaScript errors when the shortcuts have not been defined in the config file. https://github.com/FreshRSS/FreshRSS/issues/733 --- app/views/helpers/javascript_vars.phtml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 613521f0f..adf0783f3 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -35,20 +35,20 @@ echo 'var context={', "},\n"; echo 'shortcuts={', - 'mark_read:"', $s['mark_read'], '",', - 'mark_favorite:"', $s['mark_favorite'], '",', - 'go_website:"', $s['go_website'], '",', - 'prev_entry:"', $s['prev_entry'], '",', - 'next_entry:"', $s['next_entry'], '",', - 'first_entry:"', $s['first_entry'], '",', - 'last_entry:"', $s['last_entry'], '",', - 'collapse_entry:"', $s['collapse_entry'], '",', - 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '",', - 'focus_search:"', $s['focus_search'], '",', - 'user_filter:"', $s['user_filter'], '",', - 'help:"', $s['help'], '",', - 'close_dropdown:"', $s['close_dropdown'], '"', + 'mark_read:"', @$s['mark_read'], '",', + 'mark_favorite:"', @$s['mark_favorite'], '",', + 'go_website:"', @$s['go_website'], '",', + 'prev_entry:"', @$s['prev_entry'], '",', + 'next_entry:"', @$s['next_entry'], '",', + 'first_entry:"', @$s['first_entry'], '",', + 'last_entry:"', @$s['last_entry'], '",', + 'collapse_entry:"', @$s['collapse_entry'], '",', + 'load_more:"', @$s['load_more'], '",', + 'auto_share:"', @$s['auto_share'], '",', + 'focus_search:"', @$s['focus_search'], '",', + 'user_filter:"', @$s['user_filter'], '",', + 'help:"', @$s['help'], '",', + 'close_dropdown:"', @$s['close_dropdown'], '"', "},\n"; echo 'url={', -- cgit v1.2.3 From 12081f7ba2089c8046dacac23ebe44ea843d7ef1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 20 Jan 2015 23:29:04 +0100 Subject: Quick fix cron actualization due to problematic FreshRSS constructor/init https://github.com/FreshRSS/FreshRSS/issues/759 Suggestion: the static objects should be user-independent (or at least with the possibility to be re-set), while the FreshRSS object and its attributes should be user-dependent. --- app/actualize_script.php | 3 ++- lib/Minz/Configuration.php | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/actualize_script.php b/app/actualize_script.php index c7959be82..bae40aa56 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -22,7 +22,6 @@ $_SERVER['HTTP_HOST'] = ''; $app = new FreshRSS(); -$app->init(); $system_conf = Minz_Configuration::get('system'); $system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) @@ -56,7 +55,9 @@ foreach ($users as $user) { Minz_Session::_param('currentUser', $user); + new Minz_ModelPdo($user); //TODO: FIXME: Quick-fix while waiting for a better FreshRSS() constructor/init FreshRSS_Auth::giveAccess(); + $app->init(); $app->run(); diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index fe415e22b..ab5bb4fc2 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -16,16 +16,9 @@ class Minz_Configuration { * @param $config_filename the filename of the configuration * @param $default_filename a filename containing default values for the configuration * @param $configuration_setter an optional helper to set values in configuration - * @throws Minz_ConfigurationNamespaceException if the namespace already exists. */ public static function register($namespace, $config_filename, $default_filename = null, $configuration_setter = null) { - if (isset(self::$config_list[$namespace])) { - throw new Minz_ConfigurationNamespaceException( - $namespace . ' namespace already exists' - ); - } - self::$config_list[$namespace] = new Minz_Configuration( $namespace, $config_filename, $default_filename, $configuration_setter ); -- cgit v1.2.3 From 211569ef85f50891035e3e2645ec0c87badec1e1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 21 Jan 2015 00:44:26 +0100 Subject: Minz: missing URL key/param encoding Caused searches such as "intitle:&" to fail after paging, and possible XSS vulnerabilities. Discovered during https://github.com/FreshRSS/FreshRSS/issues/754 --- app/layout/header.phtml | 3 +-- app/layout/nav_menu.phtml | 3 +-- lib/Minz/Url.php | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 21 deletions(-) (limited to 'app') diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 2b968252b..41a63a565 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -25,8 +25,7 @@ if (FreshRSS_Auth::accessNeedsAction()) { allow_anonymous) { ?>
- - + diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index d35a0b5fb..3a755b560 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -156,8 +156,7 @@