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(-) 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(-) 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 fa376f746aa18d9c1e830f1f39567003cb14eaf4 Mon Sep 17 00:00:00 2001 From: Melvyn Date: Fri, 16 Jan 2015 23:31:55 +0100 Subject: Updated README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 971d53ea6..430dd82bc 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The best way is to open issues on GitHub * PHP 5.2.1+ (PHP 5.3.7+ recommanded) * Required extensions: [PDO_MySQL](http://php.net/pdo-mysql) or [PDO_SQLite](http://php.net/pdo-sqlite), [cURL](http://php.net/curl), [GMP](http://php.net/gmp) (only for API access on platforms under 64 bits) * Recommanded extensions : [JSON](http://php.net/json), [mbstring](http://php.net/mbstring), [zlib](http://php.net/zlib), [Zip](http://php.net/zip) -* MySQL 5.0.3+ (recommanded) ou SQLite 3.7.4+ +* MySQL 5.0.3+ (recommanded) or SQLite 3.7.4+ * A recent browser like Firefox 4+, Chrome, Opera, Safari, Internet Explorer 9+ * Works on mobile @@ -70,9 +70,9 @@ For example, if you want to run the script every hour: # Advices * For a better security, expose only the `./p/` folder on the web. - * Be aware that the `./data/` folder contain all personal data, so it is a bad idea to expose it. -* The `./constants.php` file define access to application folder. If you want to customize your installation, every thing happens here. -* If you encounter some problem, logs are accessibles from the interface or manually in `./data/log/*.log` files. + * Be aware that the `./data/` folder contains all personal data, so it is a bad idea to expose it. +* The `./constants.php` file defines access to application folder. If you want to customize your installation, every thing happens here. +* If you encounter any problem, logs are accessibles from the interface or manually in `./data/log/*.log` files. # Backup * You need to keep `./data/config.php`, `./data/*_user.php` and `./data/persona/` files -- 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(-) 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 6b560c61330b254e794057ef36515e4c751114f4 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 17 Jan 2015 00:08:06 -0500 Subject: Fix slider css rule (see issue #750) --- p/themes/Dark/dark.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p/themes/Dark/dark.css b/p/themes/Dark/dark.css index dd7502f25..d461040d8 100644 --- a/p/themes/Dark/dark.css +++ b/p/themes/Dark/dark.css @@ -955,6 +955,9 @@ a.btn { background: #111; color: #eee; } +#slider.active { + background-color: #1c1c1c; +} /*=== MOBILE */ /*===========*/ -- cgit v1.2.3 From 53cdfc660fb7e7067bd73eb78e2721b97cde2740 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 17 Jan 2015 11:38:27 +0100 Subject: Fix #slider in Dark theme See https://github.com/FreshRSS/FreshRSS/commit/6b560c61330b254e794057ef36515e4c751114f4 Fix https://github.com/FreshRSS/FreshRSS/issues/750 --- p/themes/Dark/dark.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/p/themes/Dark/dark.css b/p/themes/Dark/dark.css index d461040d8..cd2f85ebf 100644 --- a/p/themes/Dark/dark.css +++ b/p/themes/Dark/dark.css @@ -879,6 +879,12 @@ a.btn { border-radius: 3px; } +/*=== Slider */ +#slider { + background-color: #1c1c1c; + border-left: 1px solid #666; +} + /*=== DIVERS */ /*===========*/ .aside.aside_feed .nav-form input, @@ -955,9 +961,6 @@ a.btn { background: #111; color: #eee; } -#slider.active { - background-color: #1c1c1c; -} /*=== MOBILE */ /*===========*/ -- cgit v1.2.3 From b17cdadf15f21dc1e39ec3b270da6ae031072203 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 17 Jan 2015 10:42:24 -0500 Subject: Add the first unit test Add phpunit configuration to run tests and add the first running test to validate the configuration --- tests/app/Models/CategoryTest.php | 32 ++++++++++++++++++++++++++++++++ tests/bootstrap.php | 7 +++++++ tests/phpunit.xml | 13 +++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/app/Models/CategoryTest.php create mode 100644 tests/bootstrap.php create mode 100644 tests/phpunit.xml diff --git a/tests/app/Models/CategoryTest.php b/tests/app/Models/CategoryTest.php new file mode 100644 index 000000000..da439b785 --- /dev/null +++ b/tests/app/Models/CategoryTest.php @@ -0,0 +1,32 @@ +assertEquals(0, $category->id()); + $this->assertEquals('', $category->name()); + } + + /** + * @param string $input + * @param string $expected + * @dataProvider provideValidNames + */ + public function test_name_whenValidValue_storesModifiedValue($input, $expected) { + $category = new FreshRSS_Category($input); + $this->assertEquals($expected, $category->name()); + } + + public function provideValidNames() { + return array( + array('', ''), + array('this string does not need trimming', 'this string does not need trimming'), + array(' this string needs trimming on left', 'this string needs trimming on left'), + array('this string needs trimming on right ', 'this string needs trimming on right'), + array(' this string needs trimming on both ends ', 'this string needs trimming on both ends'), + array(str_repeat('This string needs to be shortened because its length is way too long. ', 4), str_repeat('This string needs to be shortened because its length is way too long. ', 3) . 'This string needs to be shortened because its'), + ); + } + +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000000000..24340b15c --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,7 @@ + + + + + ../app + + + + + app + + + \ No newline at end of file -- 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(-) 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(-) 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(+) 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(-) 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 9e406394950b6df386918fa5f21ff110d726cd08 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 18 Jan 2015 12:33:55 +0100 Subject: Enlarge the .item.date to contain larger date I know it's not the best solution, a dynamic width would be the best but there are some CSS constraints. I don't want to spend my time on this problem ;) Fix https://github.com/FreshRSS/FreshRSS/issues/756 --- p/themes/base-theme/template.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css index 25f206106..c6ea40f66 100644 --- a/p/themes/base-theme/template.css +++ b/p/themes/base-theme/template.css @@ -485,7 +485,7 @@ a.btn { text-decoration: none; } .flux .item.date { - width: 145px; + width: 155px; text-align: right; overflow: hidden; } -- 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(-) 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(-) 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 8b94141fec20f055e17aebe86002cd87d8acf8ad Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 19 Jan 2015 12:14:04 +0100 Subject: Add CREDIT file with name of all contributors Contributor list comes from https://github.com/FreshRSS/FreshRSS/graphs/contributors Note I didn't take responsability to add information such as personal website or email address. If you want these information appear feel free to update the file! --- CREDITS | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 CREDITS diff --git a/CREDITS b/CREDITS new file mode 100644 index 000000000..d88535a99 --- /dev/null +++ b/CREDITS @@ -0,0 +1,36 @@ +This is a credit file of people who have contributed to FreshRSS with, at least, +one commit on the FreshRSS repository (at https://github.com/FreshRSS/FreshRSS). +Please note a commit on THIS specific file is not considered as a contribution +(too easy!). It's purpose is to show even the smallest contribution is important. +People are sorted by name so please keep this order. + +--- + +Alexandre Alapetite +https://github.com/Alkarex + +Alexis Degrugillier +https://github.com/aledeg + +Alwaysin +https://github.com/Alwaysin + +Amaury Carrade +https://github.com/AmauryCarrade + +Luc Didry +https://github.com/ldidry + +Marien Fressinaud +dev@marienfressinaud.fr +http://marienfressinaud.fr +https://github.com/marienfressinaud + +Nicolas Elie +https://github.com/nicolaselie + +plopoyop +https://github.com/plopoyop + +tomgue +https://github.com/tomgue -- 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(-) 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(-) 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(-) 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(-) 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 @@