From 3dd6677421c9ba776f4734a890b4e7241c2faafb Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 21 Feb 2014 10:01:40 +0100 Subject: CHANGELOG 0.7.1 + TMP_PATH 0.8 --- constants.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index a140d0e74..4818f1565 100644 --- a/constants.php +++ b/constants.php @@ -16,5 +16,4 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('LIB_PATH', FRESHRSS_PATH . '/lib'); define('APP_PATH', FRESHRSS_PATH . '/app'); -//define('TMP_PATH', sys_get_temp_dir()); // need more tests so... -define('TMP_PATH', DATA_PATH); // ... we use DATA_PATH for the 0.7.1 +define('TMP_PATH', sys_get_temp_dir()); -- cgit v1.2.3 From fd829d75676a07a13a635db037efa92e364026a7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 24 Mar 2014 19:16:09 +0100 Subject: Constant to enable PHP compression https://github.com/marienfressinaud/FreshRSS/issues/303#issuecomment-38477994 --- constants.php | 3 +++ p/i/index.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 4818f1565..e32b8cbc3 100644 --- a/constants.php +++ b/constants.php @@ -2,6 +2,9 @@ define('FRESHRSS_VERSION', '0.8-dev'); define('FRESHRSS_WEBSITE', 'http://freshrss.org'); +// PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) +define('PHP_COMPRESSION', false); + // Constantes de chemins define('FRESHRSS_PATH', dirname(__FILE__)); diff --git a/p/i/index.php b/p/i/index.php index 187bbabe8..4afffb3dd 100755 --- a/p/i/index.php +++ b/p/i/index.php @@ -35,7 +35,7 @@ if (file_exists ('install.php')) { @filemtime(LOG_PATH . '/' . $currentUser . '.log'), @filemtime(DATA_PATH . '/config.php') ); - if (httpConditional($dateLastModification, 0, 0, false, false, true)) { + if (httpConditional($dateLastModification, 0, 0, false, PHP_COMPRESSION, true)) { exit(); //No need to send anything } } -- cgit v1.2.3 From 4580e177e1986f50c71abb26e90800dc46028693 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 13 May 2014 19:33:01 +0200 Subject: Fix version numbers Due to the last pull request --- CHANGELOG | 2 +- README.md | 4 ++-- constants.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG b/CHANGELOG index 372ec4b8d..0893283a5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # Journal des modifications -## 2014-02-19 FreshRSS 0.7.1 +## 2014-0x-xx FreshRSS 0.8 * API compatible with Google Reader API level 2 * FreshRSS can now be used from e.g.: diff --git a/README.md b/README.md index a1889bf5d..2003b6a9d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture an * Site officiel : http://freshrss.org * Démo : http://demo.freshrss.org/ * Développeur : Marien Fressinaud -* Version actuelle : 0.7.1 -* Date de publication 2014-02-19 +* Version actuelle : 0.8-dev +* Date de publication 2014-0x-xx * License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) ![Logo de FreshRSS](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png) diff --git a/constants.php b/constants.php index 849a5ada3..e32b8cbc3 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 9 Aug 2014 23:29:13 +0200 Subject: Add basic system of update - Check on update.freshrss.org for new updates - Download script - Apply script - Need translations and verifications NOTE: current script on server indicates version 0.7.3 is an update of 0.8-dev ==> IT'S ONLY FOR MY TESTS! Script just does a backup of ./data actually... See https://github.com/marienfressinaud/FreshRSS/issues/411 --- app/Controllers/updateController.php | 106 +++++++++++++++++++++++++++++++++++ app/i18n/en.php | 2 + app/i18n/fr.php | 2 + app/layout/aside_configure.phtml | 38 ++++++++----- app/layout/header.phtml | 6 ++ app/views/update/index.phtml | 19 +++++++ constants.php | 2 + lib/Minz/View.php | 15 +++-- 8 files changed, 171 insertions(+), 19 deletions(-) create mode 100644 app/Controllers/updateController.php create mode 100644 app/views/update/index.phtml (limited to 'constants.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php new file mode 100644 index 000000000..a15cb9fd5 --- /dev/null +++ b/app/Controllers/updateController.php @@ -0,0 +1,106 @@ +view->loginOk && Minz_Configuration::isAdmin($current_user)) { + Minz_Error::error( + 403, + array('error' => array(_t('access_denied'))) + ); + } + + Minz_View::prependTitle(_t('update_system') . ' · '); + } + + public function indexAction() { + if (file_exists(UPDATE_FILENAME)) { + // There is an update file to apply! + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + + return; + } + } + + public function checkAction() { + $this->view->change_view('update', 'index'); + + if (file_exists(UPDATE_FILENAME)) { + // There is already an update file to apply: we don't need to check + // the webserver! + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + + return; + } + + $c = curl_init(FRESHRSS_UPDATE_WEBSITE); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + $result = curl_exec($c); + + if (curl_getinfo($c, CURLINFO_HTTP_CODE) == 200) { + $res_array = explode("\n", $result, 2); + $status = $res_array[0]; + + if (strpos($status, 'UPDATE') === 0) { + $script = $res_array[1]; + if (file_put_contents(UPDATE_FILENAME, $script) !== false) { + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_problem') + ); + } + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('no_update') + ); + } + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_server_not_found', FRESHRSS_UPDATE_WEBSITE) + ); + } + curl_close($c); + } + + public function applyAction() { + require(UPDATE_FILENAME); + $res = apply_update(); + + if ($res === true) { + @unlink(UPDATE_FILENAME); + + Minz_Session::_param('notification', array( + 'type' => 'good', + 'content' => Minz_Translate::t('update_finished') + )); + + Minz_Request::forward(array(), true); + } else { + Minz_Session::_param('notification', array( + 'type' => 'bad', + 'content' => Minz_Translate::t('update_failed', $res) + )); + + Minz_Request::forward(array('c' => 'update'), true); + } + } +} \ No newline at end of file diff --git a/app/i18n/en.php b/app/i18n/en.php index d80299b10..6110ccb11 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -408,4 +408,6 @@ return array ( 'stats_entry_per_category' => 'Entries per category', 'stats_top_feed' => 'Top ten feeds', 'stats_entry_count' => 'Entry count', + + 'update_can_apply' => 'There is an available update. Apply', ); diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4be028ac3..5f88aa069 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -408,4 +408,6 @@ return array ( 'stats_entry_per_category' => 'Articles par catégorie', 'stats_top_feed' => 'Les dix plus gros flux', 'stats_entry_count' => 'Nombre d’articles', + + 'update_can_apply' => 'Il y’a une mise à jour à appliquer. Appliquer', ); diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index e66f2f64c..03bea4836 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,25 +1,33 @@ diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 2e42bfdea..028e63d8a 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -75,6 +75,12 @@ if (Minz_Configuration::canLogIn()) {
  • + +
  • +
  • diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml new file mode 100644 index 000000000..a1a872845 --- /dev/null +++ b/app/views/update/index.phtml @@ -0,0 +1,19 @@ +partial('aside_configure'); ?> + +
    +

    + + message)) { ?> +

    + message['title']; ?> + message['body']; ?> +

    + + + message) || $this->message['status'] !== 'good') { ?> +

    + + last_update_time); ?> +

    + +
    diff --git a/constants.php b/constants.php index e32b8cbc3..a968b82f4 100644 --- a/constants.php +++ b/constants.php @@ -1,6 +1,7 @@ change_view(Minz_Request::controllerName(), + Minz_Request::actionName()); + self::$title = Minz_Configuration::title (); + } + + /** + * Change le fichier de vue en fonction d'un controller / action + */ + public function change_view($controller_name, $action_name) { $this->view_filename = APP_PATH . self::VIEWS_PATH_NAME . '/' - . Minz_Request::controllerName () . '/' - . Minz_Request::actionName () . '.phtml'; - - self::$title = Minz_Configuration::title (); + . $controller_name . '/' + . $action_name . '.phtml'; } /** -- cgit v1.2.3 From 909d8747ba09f9c9a6ac895f1f4f0763bdb27a55 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 12 Aug 2014 20:15:46 +0200 Subject: Update system now uses HTTPS connection - Add some curl checks - Refactor code --- app/Controllers/updateController.php | 60 +++++++++++++++++++----------------- constants.php | 2 +- 2 files changed, 33 insertions(+), 29 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index fa62f4a70..857d975b2 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -44,43 +44,47 @@ class FreshRSS_update_Controller extends Minz_ActionController { $c = curl_init(FRESHRSS_UPDATE_WEBSITE); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); $result = curl_exec($c); + $c_status = curl_getinfo($c, CURLINFO_HTTP_CODE); + curl_close($c); - if (curl_getinfo($c, CURLINFO_HTTP_CODE) == 200) { - $res_array = explode("\n", $result, 2); - $status = $res_array[0]; - - if (strpos($status, 'UPDATE') === 0) { - $script = $res_array[1]; - if (file_put_contents(UPDATE_FILENAME, $script) !== false) { - $this->view->message = array( - 'status' => 'good', - 'title' => _t('ok'), - 'body' => _t('update_can_apply', _url('update', 'apply')) - ); - } else { - $this->view->message = array( - 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('update_problem', 'Cannot save the update script') - ); - } - } else { - $this->view->message = array( - 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('no_update') - ); - } - } else { + if ($c_status !== 200) { $this->view->message = array( 'status' => 'bad', 'title' => _t('damn'), 'body' => _t('update_server_not_found', FRESHRSS_UPDATE_WEBSITE) ); + return; } - curl_close($c); + $res_array = explode("\n", $result, 2); + $status = $res_array[0]; + if (strpos($status, 'UPDATE') !== 0) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('no_update') + ); + + return; + } + + $script = $res_array[1]; + if (file_put_contents(UPDATE_FILENAME, $script) !== false) { + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_problem', 'Cannot save the update script') + ); + } } public function applyAction() { diff --git a/constants.php b/constants.php index a968b82f4..ba9c508dc 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,7 @@ Date: Sun, 24 Aug 2014 11:34:58 -0400 Subject: Add shortcuts Add a shortcut to open the wiki. Shortcut is F1 and is not modifiable. Add a shortcut to access user filters the same way to access share actions. --- app/Controllers/configureController.php | 2 +- app/Models/Configuration.php | 2 ++ app/i18n/en.php | 2 ++ app/i18n/fr.php | 2 ++ app/layout/nav_menu.phtml | 2 +- app/views/configure/shortcut.phtml | 8 ++++++ app/views/helpers/javascript_vars.phtml | 7 +++-- constants.php | 1 + p/scripts/main.js | 49 ++++++++++++++++++++++++++++++++- 9 files changed, 70 insertions(+), 5 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index bb96bfae3..461cbceda 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -240,7 +240,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', + '9', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12'); $this->view->list_keys = $list_keys; diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 4c804a9fb..989603b20 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -45,6 +45,8 @@ class FreshRSS_Configuration { 'load_more' => 'm', 'auto_share' => 's', 'focus_search' => 'a', + 'user_filter' => 'u', + 'help' => 'f1', ), 'topline_read' => true, 'topline_favorite' => true, diff --git a/app/i18n/en.php b/app/i18n/en.php index be0cdc642..76da5d182 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -180,6 +180,8 @@ return array ( 'auto_share' => 'Share', 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', 'focus_search' => 'Access search box', + 'user_filter' => 'Access user filters', + 'user_filter_help' => 'If there is only one user filter, it is used. Else filters are accessible by their number.', 'file_to_import' => 'File to import
    (OPML, Json or Zip)', 'file_to_import_no_zip' => 'File to import
    (OPML or Json)', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 08f12234e..a8f7a3a98 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -180,6 +180,8 @@ return array ( 'auto_share' => 'Partager', 'auto_share_help' => 'S’il n’y a qu’un mode de partage, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', 'focus_search' => 'Accéder à la recherche', + 'user_filter' => 'Accéder aux filtres utilisateur', + 'user_filter_help' => 'S’il n’y a qu’un filtre utilisateur, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', 'file_to_import' => 'Fichier à importer
    (OPML, Json ou Zip)', 'file_to_import_no_zip' => 'Fichier à importer
    (OPML ou Json)', diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 25833c16d..7cd15c1a3 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -96,7 +96,7 @@ conf->queries as $query) { ?> -
  • +
  • diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index bfb13f003..73ad0ebb8 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -103,6 +103,14 @@ +
    + +
    + + +
    +
    +
    diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 7144c519a..2144f1576 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -4,7 +4,8 @@ echo '"use strict";', "\n"; $mark = $this->conf->mark_when; echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + 'help_url="', FRESHRSS_WIKI, '"', + ',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"', ',auto_mark_article=', $mark['article'] ? 'true' : 'false', ',auto_mark_site=', $mark['site'] ? 'true' : 'false', @@ -25,7 +26,9 @@ echo ',shortcuts={', 'collapse_entry:"', $s['collapse_entry'], '",', 'load_more:"', $s['load_more'], '",', 'auto_share:"', $s['auto_share'], '",', - 'focus_search:"', $s['focus_search'], '"', + 'focus_search:"', $s['focus_search'], '",', + 'user_filter:"', $s['user_filter'], '",', + 'help:"', $s['help'], '"', "},\n"; if (Minz_Request::param ('output') === 'global') { diff --git a/constants.php b/constants.php index e32b8cbc3..483989371 100644 --- a/constants.php +++ b/constants.php @@ -1,6 +1,7 @@ Date: Sun, 24 Aug 2014 12:46:40 -0400 Subject: Change wiki url --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 483989371..90c7a38e4 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,7 @@ Date: Tue, 30 Sep 2014 10:10:06 +0200 Subject: We are working on 0.10-dev... but it could be the 1.0! --- CHANGELOG | 2 +- README.fr.md | 4 ++-- README.md | 4 ++-- constants.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG b/CHANGELOG index d7de86d9b..44d3452ae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # Journal des modifications -## 2014-09-xx FreshRSS 0.8.0 +## 2014-09-26 FreshRSS 0.8.0 / 0.9.0 (beta) * UI * New interface for statistics diff --git a/README.fr.md b/README.fr.md index df43ef7e8..4e6c52d68 100644 --- a/README.fr.md +++ b/README.fr.md @@ -10,8 +10,8 @@ Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture an * Site officiel : http://freshrss.org * Démo : http://demo.freshrss.org/ * Développeur : Marien Fressinaud -* Version actuelle : 0.8-dev -* Date de publication 2014-0x-xx +* Version actuelle : 0.10-dev +* Date de publication 2014-xx-xx * License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) ![Logo de FreshRSS](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png) diff --git a/README.md b/README.md index 0a22df8f1..971d53ea6 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ It is a multi-user application with an anonymous reading mode. * Official website: http://freshrss.org * Demo: http://demo.freshrss.org/ * Developer: Marien Fressinaud -* Current version: 0.8-dev -* Publication date: 2014-0x-xx +* Current version: 0.10-dev +* Publication date: 2014-xx-xx * License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) ![FreshRSS logo](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png) diff --git a/constants.php b/constants.php index 4c515d121..f66a012b0 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Thu, 4 Dec 2014 19:33:29 +0100 Subject: First draft for the new extension feature - Only system extensions can be loaded for the moment by adding them in the config.php file. - Remove previous system (it will be added properly in the new system in the next step). --- app/FreshRSS.php | 42 +++++------ constants.php | 3 +- extensions/README.md | 15 ++++ extensions/Read-me.txt | 15 ---- lib/Minz/Configuration.php | 10 +++ lib/Minz/Extension.php | 96 +++++++++++++++++++++++++ lib/Minz/ExtensionException.php | 15 ++++ lib/Minz/ExtensionManager.php | 150 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 310 insertions(+), 36 deletions(-) create mode 100644 extensions/README.md delete mode 100644 extensions/Read-me.txt create mode 100644 lib/Minz/Extension.php create mode 100644 lib/Minz/ExtensionException.php create mode 100644 lib/Minz/ExtensionManager.php (limited to 'constants.php') diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 6114a5d1a..2db811a71 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -6,6 +6,9 @@ class FreshRSS extends Minz_FrontController { Minz_Session::init('FreshRSS'); } + // Load list of extensions and initialize the "system" ones. + Minz_ExtensionManager::init(); + // Need to be called just after session init because it initializes // current user. FreshRSS_Auth::init(); @@ -32,7 +35,6 @@ class FreshRSS extends Minz_FrontController { $this->loadStylesAndScripts(); $this->loadNotifications(); - $this->loadExtensions(); } private function loadStylesAndScripts() { @@ -74,23 +76,23 @@ class FreshRSS extends Minz_FrontController { } } - private function loadExtensions() { - $extensionPath = FRESHRSS_PATH . '/extensions/'; - //TODO: Add a preference to load only user-selected extensions - foreach (scandir($extensionPath) as $key => $extension) { - if (ctype_alpha($extension)) { - $mtime = @filemtime($extensionPath . $extension . '/style.css'); - if ($mtime !== false) { - Minz_View::appendStyle(Minz_Url::display('/ext.php?c&e=' . $extension . '&' . $mtime)); - } - $mtime = @filemtime($extensionPath . $extension . '/script.js'); - if ($mtime !== false) { - Minz_View::appendScript(Minz_Url::display('/ext.php?j&e=' . $extension . '&' . $mtime)); - } - if (file_exists($extensionPath . $extension . '/module.php')) { - //TODO: include - } - } - } - } + // private function loadExtensions() { + // $extensionPath = FRESHRSS_PATH . '/extensions/'; + // //TODO: Add a preference to load only user-selected extensions + // foreach (scandir($extensionPath) as $key => $extension) { + // if (ctype_alpha($extension)) { + // $mtime = @filemtime($extensionPath . $extension . '/style.css'); + // if ($mtime !== false) { + // Minz_View::appendStyle(Minz_Url::display('/ext.php?c&e=' . $extension . '&' . $mtime)); + // } + // $mtime = @filemtime($extensionPath . $extension . '/script.js'); + // if ($mtime !== false) { + // Minz_View::appendScript(Minz_Url::display('/ext.php?j&e=' . $extension . '&' . $mtime)); + // } + // if (file_exists($extensionPath . $extension . '/module.php')) { + // //TODO: include + // } + // } + // } + // } } diff --git a/constants.php b/constants.php index f66a012b0..999e703ba 100644 --- a/constants.php +++ b/constants.php @@ -20,6 +20,7 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('CACHE_PATH', DATA_PATH . '/cache'); define('LIB_PATH', FRESHRSS_PATH . '/lib'); - define('APP_PATH', FRESHRSS_PATH . '/app'); + define('APP_PATH', FRESHRSS_PATH . '/app'); + define('EXTENSIONS_PATH', FRESHRSS_PATH . '/extensions'); define('TMP_PATH', sys_get_temp_dir()); diff --git a/extensions/README.md b/extensions/README.md new file mode 100644 index 000000000..e7b66d5bc --- /dev/null +++ b/extensions/README.md @@ -0,0 +1,15 @@ +== FreshRSS extensions == + +You may place in this directory some custom extensions for FreshRSS. + +The structure must be: + +./FreshRSS/extensions/ + ./NameOfExtensionAlphanumeric/ + ./style.css + ./script.js + ./module.php + +Each file is optional. + +The name of non-official extensions should start by an 'x'. diff --git a/extensions/Read-me.txt b/extensions/Read-me.txt deleted file mode 100644 index e7b66d5bc..000000000 --- a/extensions/Read-me.txt +++ /dev/null @@ -1,15 +0,0 @@ -== FreshRSS extensions == - -You may place in this directory some custom extensions for FreshRSS. - -The structure must be: - -./FreshRSS/extensions/ - ./NameOfExtensionAlphanumeric/ - ./style.css - ./script.js - ./module.php - -Each file is optional. - -The name of non-official extensions should start by an 'x'. diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 6cbc9fc0b..4d3ab0964 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -69,6 +69,8 @@ class Minz_Configuration { 'max_categories' => Minz_Configuration::MAX_SMALL_INT, ); + private static $extensions_enabled = array(); + /* * Getteurs */ @@ -133,6 +135,9 @@ class Minz_Configuration { public static function unsafeAutologinEnabled() { return self::$unsafe_autologin_enabled; } + public static function extensionsEnabled() { + return self::$extensions_enabled; + } public static function _allowAnonymous($allow = false) { self::$allow_anonymous = ((bool)$allow) && self::canLogIn(); @@ -338,6 +343,11 @@ class Minz_Configuration { } } + // Extensions + if (isset($ini_array['extensions']) && is_array($ini_array['extensions'])) { + self::$extensions_enabled = $ini_array['extensions']; + } + // Base de données if (isset ($ini_array['db'])) { $db = $ini_array['db']; diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php new file mode 100644 index 000000000..f442344a3 --- /dev/null +++ b/lib/Minz/Extension.php @@ -0,0 +1,96 @@ +name = $meta_info['name']; + $this->entrypoint = $meta_info['entrypoint']; + $this->path = $meta_info['path']; + $this->author = isset($meta_info['author']) ? $meta_info['author'] : ''; + $this->description = isset($meta_info['description']) ? $meta_info['description'] : ''; + $this->version = isset($meta_info['version']) ? $meta_info['version'] : '0.1'; + $this->setType(isset($meta_info['type']) ? $meta_info['type'] : 'user'); + } + + /** + * Used when installing an extension (e.g. update the database scheme). + * + * It must be redefined by child classes. + */ + public function install() {} + + /** + * Used when uninstalling an extension (e.g. revert the database scheme to + * cancel changes from install). + * + * It must be redefined by child classes. + */ + public function uninstall() {} + + /** + * Call at the initialization of the extension (i.e. when the extension is + * enabled by the extension manager). + * + * It must be redefined by child classes. + */ + public function init() {} + + /** + * Getters and setters. + */ + public function getName() { + return $this->name; + } + public function getEntrypoint() { + return $this->entrypoint; + } + public function getAuthor() { + return $this->author; + } + public function getDescription() { + return $this->description; + } + public function getVersion() { + return $this->version; + } + public function getType() { + return $this->type; + } + private function setType($type) { + if (!in_array($type, self::$authorized_types)) { + throw new Minz_ExtensionException('invalid `type` info', $this->name); + } + $this->type = $type; + } +} diff --git a/lib/Minz/ExtensionException.php b/lib/Minz/ExtensionException.php new file mode 100644 index 000000000..647f1a9b9 --- /dev/null +++ b/lib/Minz/ExtensionException.php @@ -0,0 +1,15 @@ +Extension where + * must match with the entry point in metadata.json. This class must + * inherit from Minz_Extension class. + */ + public static function init() { + $list_potential_extensions = array_values(array_diff( + scandir(EXTENSIONS_PATH), + array('..', '.') + )); + + self::$ext_auto_enabled = Minz_Configuration::extensionsEnabled(); + + foreach ($list_potential_extensions as $ext_dir) { + $ext_pathname = EXTENSIONS_PATH . '/' . $ext_dir; + $metadata_filename = $ext_pathname . '/' . self::$ext_metaname; + + // Try to load metadata file. + if (!file_exists($metadata_filename)) { + // No metadata file? Invalid! + continue; + } + $meta_raw_content = file_get_contents($metadata_filename); + $meta_json = json_decode($meta_raw_content, true); + if (!$meta_json || !self::is_valid_metadata($meta_json)) { + // metadata.json is not a json file? Invalid! + // or metadata.json is invalid (no required information), invalid! + Minz_Log::warning('`' . $metadata_filename . '` is not a valid metadata file'); + continue; + } + + $meta_json['path'] = $ext_pathname; + + // Try to load extension itself + $extension = self::load($meta_json); + if (!is_null($extension)) { + self::register($extension); + } + } + } + + /** + * Indicates if the given parameter is a valid metadata array. + * + * Required fields are: + * - `name`: the name of the extension + * - `entry_point`: a class name to load the extension source code + * If the extension class name is `TestExtension`, entry point will be `Test`. + * `entry_point` must be composed of alphanumeric characters. + * + * @param $meta is an array of values. + * @return true if the array is valid, false else. + */ + public static function is_valid_metadata($meta) { + return !(empty($meta['name']) || + empty($meta['entrypoint']) || + !ctype_alnum($meta['entrypoint'])); + } + + /** + * Load the extension source code based on info metadata. + * + * @param $info an array containing information about extension. + * @return an extension inheriting from Minz_Extension. + */ + public static function load($info) { + $entry_point_filename = $info['path'] . '/' . self::$ext_entry_point; + $ext_class_name = $info['entrypoint'] . 'Extension'; + + include($entry_point_filename); + + // Test if the given extension class exists. + if (!class_exists($ext_class_name)) { + Minz_Log::warning('`' . $ext_class_name . + '` cannot be found in `' . $entry_point_filename . '`'); + return null; + } + + // Try to load the class. + $extension = null; + try { + $extension = new $ext_class_name($info); + } catch (Minz_ExtensionException $e) { + // We cannot load the extension? Invalid! + Minz_Log::warning('In `' . $metadata_filename . '`: ' . $e->getMessage()); + return null; + } + + // Test if class is correct. + if (!($extension instanceof Minz_Extension)) { + Minz_Log::warning('`' . $ext_class_name . + '` is not an instance of `Minz_Extension`'); + return null; + } + + return $extension; + } + + /** + * Add the extension to the list of the known extensions ($ext_list). + * + * If the extension is present in $ext_auto_enabled and if its type is "system", + * it will be enabled in the same time. + * + * @param $ext a valid extension. + */ + public static function register($ext) { + $name = $ext->getName(); + self::$ext_list[$name] = $ext; + + if ($ext->getType() === 'system' && + in_array($name, self::$ext_auto_enabled)) { + self::enable($ext->getName()); + } + } + + /** + * Enable an extension so it will be called when necessary. + * + * The extension init() method will be called. + * + * @param $ext_name is the name of a valid extension present in $ext_list. + */ + public static function enable($ext_name) { + if (isset(self::$ext_list[$ext_name])) { + $ext = self::$ext_list[$ext_name]; + self::$ext_list_enabled[$ext_name] = $ext; + $ext->init(); + } + } +} -- cgit v1.2.3 From 039a83759d41615aaa593fa62deff4c25fc126a2 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 28 Dec 2014 17:42:46 +0100 Subject: Fix install.php to consider new data organization - Introduce USERS_PATH - Remove LOG_PATH - Use join_path in install.php - Change references to old data files to the new ones - Update i18n See https://github.com/FreshRSS/FreshRSS/issues/729 --- app/i18n/en/install.php | 9 +++++---- app/i18n/fr/install.php | 9 +++++---- app/install.php | 49 +++++++++++++++++++++++++++---------------------- constants.php | 2 +- 4 files changed, 38 insertions(+), 31 deletions(-) (limited to 'constants.php') diff --git a/app/i18n/en/install.php b/app/i18n/en/install.php index ed3210190..e8073e8b6 100644 --- a/app/i18n/en/install.php +++ b/app/i18n/en/install.php @@ -3,6 +3,7 @@ return array( 'action' => array( 'finish' => 'Complete installation', + 'fix_errors_before' => 'Fix errors before skip to the next step.', 'next_step' => 'Go to the next step', ), 'auth' => array( @@ -57,10 +58,6 @@ return array( 'nok' => 'Please check that you are not altering your HTTP REFERER.', 'ok' => 'Your HTTP REFERER is known and corresponds to your server.', ), - 'logs' => array( - 'nok' => 'Check permissions on ./data/logs directory. HTTP server must have rights to write into', - 'ok' => 'Permissions on logs directory are good.', - ), 'minz' => array( 'nok' => 'You lack the Minz framework.', 'ok' => 'You have the Minz framework.', @@ -81,6 +78,10 @@ return array( 'nok' => 'Your PHP version is %s but FreshRSS requires at least version %s.', 'ok' => 'Your PHP version is %s, which is compatible with FreshRSS.', ), + 'users' => array( + 'nok' => 'Check permissions on ./data/users directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on users directory are good.', + ), ), 'conf' => array( '_' => 'General configuration', diff --git a/app/i18n/fr/install.php b/app/i18n/fr/install.php index f1ef2ea3f..d1b78ffb6 100644 --- a/app/i18n/fr/install.php +++ b/app/i18n/fr/install.php @@ -3,6 +3,7 @@ return array( 'action' => array( 'finish' => 'Terminer l’installation', + 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', 'next_step' => 'Passer à l’étape suivante', ), 'auth' => array( @@ -57,10 +58,6 @@ return array( 'nok' => 'Veuillez vérifier que vous ne modifiez pas votre HTTP REFERER.', 'ok' => 'Le HTTP REFERER est connu et semble correspondre à votre serveur.', ), - 'logs' => array( - 'nok' => 'Veuillez vérifier les droits sur le répertoire ./data/logs. Le serveur HTTP doit être capable d’écrire dedans', - 'ok' => 'Les droits sur le répertoire des logs sont bons.', - ), 'minz' => array( 'nok' => 'Vous ne disposez pas de la librairie Minz.', 'ok' => 'Vous disposez du framework Minz', @@ -81,6 +78,10 @@ return array( 'nok' => 'Votre version de PHP est la %s mais FreshRSS requiert au moins la version %s.', 'ok' => 'Votre version de PHP est la %s, qui est compatible avec FreshRSS.', ), + 'users' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire ./data/users. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire des utilisateurs sont bons.', + ), ), 'conf' => array( '_' => 'Configuration générale', diff --git a/app/install.php b/app/install.php index 8091a9eb0..8b65fbb6f 100644 --- a/app/install.php +++ b/app/install.php @@ -132,12 +132,17 @@ function saveStep2() { 'token' => $token, ); - $configPath = DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'; - @unlink($configPath); //To avoid access-rights problems - file_put_contents($configPath, " PDO::ERRMODE_EXCEPTION, ); @@ -229,7 +234,7 @@ function newPdo() { } function deleteInstall() { - $res = unlink(DATA_PATH . '/do-install.txt'); + $res = unlink(join_path(DATA_PATH, 'do-install.txt')); if (!$res) { return false; @@ -270,7 +275,7 @@ function checkStep0() { function checkStep1() { $php = version_compare(PHP_VERSION, '5.2.1') >= 0; - $minz = file_exists(LIB_PATH . '/Minz'); + $minz = file_exists(join_path(LIB_PATH, 'Minz')); $curl = extension_loaded('curl'); $pdo_mysql = extension_loaded('pdo_mysql'); $pdo_sqlite = extension_loaded('pdo_sqlite'); @@ -280,9 +285,9 @@ function checkStep1() { $dom = class_exists('DOMDocument'); $data = DATA_PATH && is_writable(DATA_PATH); $cache = CACHE_PATH && is_writable(CACHE_PATH); - $log = LOG_PATH && is_writable(LOG_PATH); - $favicons = is_writable(DATA_PATH . '/favicons'); - $persona = is_writable(DATA_PATH . '/persona'); + $users = USERS_PATH && is_writable(USERS_PATH); + $favicons = is_writable(join_path(DATA_PATH, 'favicons')); + $persona = is_writable(join_path(DATA_PATH, 'persona')); $http_referer = is_referer_from_same_domain(); return array( @@ -297,12 +302,12 @@ function checkStep1() { 'dom' => $dom ? 'ok' : 'ko', 'data' => $data ? 'ok' : 'ko', 'cache' => $cache ? 'ok' : 'ko', - 'log' => $log ? 'ok' : 'ko', + 'users' => $users ? 'ok' : 'ko', 'favicons' => $favicons ? 'ok' : 'ko', 'persona' => $persona ? 'ok' : 'ko', 'http_referer' => $http_referer ? 'ok' : 'ko', 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && - $data && $cache && $log && $favicons && $persona && $http_referer ? + $data && $cache && $users && $favicons && $persona && $http_referer ? 'ok' : 'ko' ); } @@ -327,7 +332,7 @@ function checkStep2() { if ($defaultUser === null) { $defaultUser = empty($_SESSION['default_user']) ? '' : $_SESSION['default_user']; } - $data = is_writable(DATA_PATH . '/' . $defaultUser . '_user.php'); + $data = is_writable(join_path(USERS_PATH, $defaultUser, 'config.php')); return array( 'conf' => $conf ? 'ok' : 'ko', @@ -339,7 +344,7 @@ function checkStep2() { } function checkStep3() { - $conf = is_writable(DATA_PATH . '/config.php'); + $conf = is_writable(join_path(DATA_PATH, 'config.php')); $bd = isset($_SESSION['bd_type']) && isset($_SESSION['bd_host']) && @@ -382,7 +387,7 @@ function checkBD() { $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; break; case 'sqlite': - $str = 'sqlite:' . DATA_PATH . '/' . $_SESSION['default_user'] . '.sqlite'; + $str = 'sqlite:' . join_path(USERS_PATH, $_SESSION['default_user'], 'db.sqlite'); $driver_options = array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, ); @@ -414,7 +419,7 @@ function checkBD() { } if (!$ok) { - @unlink(DATA_PATH . '/config.php'); + @unlink(join_path(DATA_PATH, 'config.php')); } return $ok; @@ -470,7 +475,7 @@ function printStep1() {

    -

    +

    @@ -516,10 +521,10 @@ function printStep1() {

    - -

    + +

    -

    +

    diff --git a/constants.php b/constants.php index f66a012b0..07dd6f18e 100644 --- a/constants.php +++ b/constants.php @@ -16,7 +16,7 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('DATA_PATH', FRESHRSS_PATH . '/data'); define('UPDATE_FILENAME', DATA_PATH . '/update.php'); - define('LOG_PATH', DATA_PATH . '/log'); + define('USERS_PATH', DATA_PATH . '/users'); define('CACHE_PATH', DATA_PATH . '/cache'); define('LIB_PATH', FRESHRSS_PATH . '/lib'); -- cgit v1.2.3 From 88f94661f3e4a7007938f237f3a74753446abeae Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 3 Feb 2015 10:32:41 +0100 Subject: New version number for dev (1.2-dev) --- CHANGELOG | 2 ++ constants.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG b/CHANGELOG index b389f184b..d1b49d339 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ # Changelog +## 2015-xx-xx FreshRSS 1.1.1 (beta) + ## 2015-01-31 FreshRSS 1.0.0 / 1.1.0 (beta) * UI diff --git a/constants.php b/constants.php index 8136afc85..b20bf0710 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Fri, 15 May 2015 03:21:36 +0200 Subject: First draft of PubSubHubbub https://github.com/FreshRSS/FreshRSS/issues/312 Requires setting base_url in config.php. Currently using the filesystem (no change to the database) --- app/Controllers/feedController.php | 55 +++++++++++------ app/Models/Feed.php | 69 ++++++++++++++++++++- constants.php | 1 + data/PubSubHubbub/feeds/.gitignore | 1 + data/PubSubHubbub/feeds/README.md | 12 ++++ data/PubSubHubbub/secrets/.gitignore | 1 + data/PubSubHubbub/secrets/README.md | 4 ++ data/config.default.php | 8 ++- lib/lib_rss.php | 9 +++ p/api/pshb.php | 116 +++++++++++++++++++++++++++++++++++ 10 files changed, 252 insertions(+), 24 deletions(-) create mode 100644 data/PubSubHubbub/feeds/.gitignore create mode 100644 data/PubSubHubbub/feeds/README.md create mode 100644 data/PubSubHubbub/secrets/.gitignore create mode 100644 data/PubSubHubbub/secrets/README.md create mode 100644 p/api/pshb.php (limited to 'constants.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 0443b4159..9117da639 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -168,6 +168,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { // Ok, feed has been added in database. Now we have to refresh entries. $feed->_id($id); $feed->faviconPrepare(); + $feed->pubSubHubbubPrepare(); $is_read = FreshRSS_Context::$user_conf->mark_when['reception'] ? 1 : 0; @@ -261,12 +262,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { * This action actualizes entries from one or several feeds. * * Parameters are: - * - id (default: false) + * - id (default: false): Feed ID + * - url (default: false): Feed URL * - force (default: false) - * If id is not specified, all the feeds are actualized. But if force is + * If id and url are not specified, all the feeds are actualized. But if force is * false, process stops at 10 feeds to avoid time execution problem. */ - public function actualizeAction() { + public function actualizeAction($simplePie = null) { @set_time_limit(300); $feedDAO = FreshRSS_Factory::createFeedDao(); @@ -274,14 +276,15 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Session::_param('actualize_feeds', false); $id = Minz_Request::param('id'); + $url = Minz_Request::param('url'); $force = Minz_Request::param('force'); // Create a list of feeds to actualize. // If id is set and valid, corresponding feed is added to the list but // alone in order to automatize further process. $feeds = array(); - if ($id) { - $feed = $feedDAO->searchById($id); + if ($id || $url) { + $feed = $id ? $feedDAO->searchById($id) : $feedDAO->searchByUrl($url); if ($feed) { $feeds[] = $feed; } @@ -302,8 +305,11 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } try { - // Load entries - $feed->load(false); + if ($simplePie) { + $feed->loadEntries($simplePie); //Used by PubSubHubbub + } else { + $feed->load(false); + } } catch (FreshRSS_Feed_Exception $e) { Minz_Log::notice($e->getMessage()); $feedDAO->updateLastUpdate($feed->id(), true); @@ -404,7 +410,16 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feedDAO->updateFeed($feed->id(), array('url' => $feed->url())); } - $feed->faviconPrepare(); + if ($simplePie === null) { + $feed->faviconPrepare(); + if ($feed->url() === 'http://push-pub.appspot.com/feed') { + $secret = $feed->pubSubHubbubPrepare(); + if ($secret != '') { + Minz_Log::debug('PubSubHubbub subscribe ' . $feed->url()); + $feed->pubSubHubbubSubscribe(true, $secret); + } + } + } $feed->unlock(); $updated_feeds++; unset($feed); @@ -427,20 +442,20 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Session::_param('notification', $notif); // No layout in ajax request. $this->view->_useLayout(false); - return; - } - - // Redirect to the main page with correct notification. - if ($updated_feeds === 1) { - $feed = reset($feeds); - Minz_Request::good(_t('feedback.sub.feed.actualized', $feed->name()), array( - 'params' => array('get' => 'f_' . $feed->id()) - )); - } elseif ($updated_feeds > 1) { - Minz_Request::good(_t('feedback.sub.feed.n_actualized', $updated_feeds), array()); } else { - Minz_Request::good(_t('feedback.sub.feed.no_refresh'), array()); + // Redirect to the main page with correct notification. + if ($updated_feeds === 1) { + $feed = reset($feeds); + Minz_Request::good(_t('feedback.sub.feed.actualized', $feed->name()), array( + 'params' => array('get' => 'f_' . $feed->id()) + )); + } elseif ($updated_feeds > 1) { + Minz_Request::good(_t('feedback.sub.feed.n_actualized', $updated_feeds), array()); + } else { + Minz_Request::good(_t('feedback.sub.feed.no_refresh'), array()); + } } + return $updated_feeds; } /** diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 85fb173ec..dcf083ea8 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -19,6 +19,8 @@ class FreshRSS_Feed extends Minz_Model { private $ttl = -2; private $hash = null; private $lockPath = ''; + private $hubUrl = ''; + private $selfUrl = ''; public function __construct($url, $validate=true) { if ($validate) { @@ -226,6 +228,11 @@ class FreshRSS_Feed extends Minz_Model { throw new FreshRSS_Feed_Exception(($errorMessage == '' ? 'Feed error' : $errorMessage) . ' [' . $url . ']'); } + $links = $feed->get_links('self'); + $this->selfUrl = isset($links[0]) ? $links[0] : null; + $links = $feed->get_links('hub'); + $this->hubUrl = isset($links[0]) ? $links[0] : null; + if ($loadDetails) { // si on a utilisé l'auto-discover, notre url va avoir changé $subscribe_url = $feed->subscribe_url(false); @@ -259,7 +266,7 @@ class FreshRSS_Feed extends Minz_Model { } } - private function loadEntries($feed) { + public function loadEntries($feed) { $entries = array(); foreach ($feed->get_items() as $item) { @@ -333,4 +340,64 @@ class FreshRSS_Feed extends Minz_Model { function unlock() { @unlink($this->lockPath); } + + // + + function pubSubHubbubPrepare() { + $secret = ''; + if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl) { + $path = PSHB_PATH . '/feeds/' . base64url_encode($this->selfUrl); + if (!file_exists($path . '/hub.txt')) { + @mkdir($path, 0777, true); + file_put_contents($path . '/hub.txt', $this->hubUrl); + $secret = sha1(FreshRSS_Context::$system_conf->salt . uniqid(mt_rand(), true)); + file_put_contents($path . '/secret.txt', $secret); + @mkdir(PSHB_PATH . '/secrets/'); + file_put_contents(PSHB_PATH . '/secrets/' . $secret . '.txt', base64url_encode($this->selfUrl)); + Minz_Log::notice('PubSubHubbub prepared for ' . $this->url); + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . + 'PubSubHubbub prepared for ' . $this->url . "\n", FILE_APPEND); + } + $path .= '/' . base64url_encode($this->url); + $currentUser = Minz_Session::param('currentUser'); + if (ctype_alnum($currentUser) && !file_exists($path . '/' . $currentUser . '.txt')) { + @mkdir($path, 0777, true); + touch($path . '/' . $currentUser . '.txt'); + } + } + return $secret; + } + + //Parameter true to subscribe, false to unsubscribe. + function pubSubHubbubSubscribe($state, $secret = '') { + if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl) { + $callbackUrl = checkUrl(FreshRSS_Context::$system_conf->base_url . 'api/pshb.php?s=' . $secret); + if ($callbackUrl == '') { + return false; + } + + $ch = curl_init(); + curl_setopt_array($ch, array( + CURLOPT_URL => $this->hubUrl, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_USERAGENT => _t('gen.freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')', + CURLOPT_POSTFIELDS => 'hub.verify=sync' + . '&hub.mode=' . ($state ? 'subscribe' : 'unsubscribe') + . '&hub.topic=' . urlencode($this->selfUrl) + . '&hub.callback=' . urlencode($callbackUrl) + ) + ); + $response = curl_exec($ch); + $info = curl_getinfo($ch); + + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . + 'PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $this->selfUrl . + ' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response . "\n", FILE_APPEND); + return substr($info['http_code'], 0, 1) == '2'; + } + return false; + } + + // } diff --git a/constants.php b/constants.php index b20bf0710..5bb410e29 100644 --- a/constants.php +++ b/constants.php @@ -18,6 +18,7 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('UPDATE_FILENAME', DATA_PATH . '/update.php'); define('USERS_PATH', DATA_PATH . '/users'); define('CACHE_PATH', DATA_PATH . '/cache'); + define('PSHB_PATH', DATA_PATH . '/PubSubHubbub'); define('LIB_PATH', FRESHRSS_PATH . '/lib'); define('APP_PATH', FRESHRSS_PATH . '/app'); diff --git a/data/PubSubHubbub/feeds/.gitignore b/data/PubSubHubbub/feeds/.gitignore new file mode 100644 index 000000000..150f68c80 --- /dev/null +++ b/data/PubSubHubbub/feeds/.gitignore @@ -0,0 +1 @@ +*/* diff --git a/data/PubSubHubbub/feeds/README.md b/data/PubSubHubbub/feeds/README.md new file mode 100644 index 000000000..15fa8e521 --- /dev/null +++ b/data/PubSubHubbub/feeds/README.md @@ -0,0 +1,12 @@ +List of canonical URLS of the various feeds users have subscribed to. +Several feeds can share the same canonical URL (rel="self"). +Several users can have subscribed to the same feed. + +* ./base64url(canonicalUrl)/ + * ./secret.txt + * ./base64url(feedUrl1)/ + * ./user1.txt + * ./user2.txt + * ./base64url(feedUrl2)/ + * ./user3.txt + * ./user4.txt diff --git a/data/PubSubHubbub/secrets/.gitignore b/data/PubSubHubbub/secrets/.gitignore new file mode 100644 index 000000000..2211df63d --- /dev/null +++ b/data/PubSubHubbub/secrets/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/data/PubSubHubbub/secrets/README.md b/data/PubSubHubbub/secrets/README.md new file mode 100644 index 000000000..ad8158839 --- /dev/null +++ b/data/PubSubHubbub/secrets/README.md @@ -0,0 +1,4 @@ +List of secrets given to PubSubHubbub hubs + +* ./sha1(random + salt).txt + * base64url(canonicalUrl) diff --git a/data/config.default.php b/data/config.default.php index 8be203d36..80d331df7 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -11,9 +11,11 @@ return array( # Used to make crypto more unique. Generated during install. 'salt' => '', - # Leave empty for most cases. - # Ability to override the address of the FreshRSS instance, - # used when building absolute URLs. + # Specify address of the FreshRSS instance, + # used when building absolute URLs, e.g. for PubSubHubbub. + # Examples: + # https://example.net/FreshRSS/p/ + # https://freshrss.example.net/ 'base_url' => '', # Natural language of the user interface, e.g. `en`, `fr`. diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 6342011c8..191a58f35 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -446,3 +446,12 @@ function array_push_unique(&$array, $value) { function array_remove(&$array, $value) { $array = array_diff($array, array($value)); } + +//RFC 4648 +function base64url_encode($data) { + return strtr(rtrim(base64_encode($data), '='), '+/', '-_'); +} +//RFC 4648 +function base64url_decode($data) { + return base64_decode(strtr($data, '-_', '+/')); +} diff --git a/p/api/pshb.php b/p/api/pshb.php new file mode 100644 index 000000000..bcb8341b1 --- /dev/null +++ b/p/api/pshb.php @@ -0,0 +1,116 @@ + $_GET, '_POST' => $_POST, 'INPUT' => $ORIGINAL_INPUT), true)); + +$secret = isset($_GET['s']) ? substr($_GET['s'], 0, 128) : ''; +if (!ctype_xdigit($secret)) { + header('HTTP/1.1 422 Unprocessable Entity'); + die('Invalid feed secret format!'); +} +chdir(PSHB_PATH); +$canonical64 = @file_get_contents('secrets/' . $secret . '.txt'); +if ($canonical64 === false) { + header('HTTP/1.1 404 Not Found'); + logMe('Feed secret not found!: ' . $secret); + die('Feed secret not found!'); +} +$canonical64 = trim($canonical64); +if (!preg_match('/^[A-Za-z0-9_-]+$/D', $canonical64)) { + header('HTTP/1.1 500 Internal Server Error'); + logMe('Invalid secret reference!: ' . $canonical64); + die('Invalid secret reference!'); +} +$secret2 = @file_get_contents('feeds/' . $canonical64 . '/secret.txt'); +if ($secret2 === false) { + header('HTTP/1.1 404 Not Found'); + //@unlink('secrets/' . $secret . '.txt'); + logMe('Feed reverse secret not found!: ' . $canonical64); + die('Feed reverse secret not found!'); +} +if ($secret !== $secret2) { + header('HTTP/1.1 500 Internal Server Error'); + logMe('Invalid secret cross-check!: ' . $secret); + die('Invalid secret cross-check!'); +} +chdir('feeds/' . $canonical64); +$users = glob('*/*.txt', GLOB_NOSORT); +if (empty($users)) { + header('HTTP/1.1 410 Gone'); + logMe('Nobody is subscribed to this feed anymore!: ' . $canonical64); + die('Nobody is subscribed to this feed anymore!'); +} + +if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'subscribe') { + //TODO: hub_lease_seconds + exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); +} + +Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php'); +$system_conf = Minz_Configuration::get('system'); +$system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) +Minz_Translate::init('en'); +Minz_Request::_param('ajax', true); +$feedController = new FreshRSS_feed_Controller(); + +$simplePie = customSimplePie(); +$simplePie->set_raw_data($ORIGINAL_INPUT); +$simplePie->init(); +unset($ORIGINAL_INPUT); + +$links = $simplePie->get_links('self'); +$self = isset($links[0]) ? $links[0] : null; + +if ($self !== base64url_decode($canonical64)) { + header('HTTP/1.1 422 Unprocessable Entity'); + logMe('Self URL does not match registered canonical URL!: ' . $self); + die('Self URL does not match registered canonical URL!'); +} +Minz_Request::_param('url', $self); + +$nb = 0; +foreach ($users as $userLine) { + $userLine = strtr($userLine, '\\', '/'); + $userInfos = explode('/', $userLine); + $feedUrl = isset($userInfos[0]) ? base64url_decode($userInfos[0]) : ''; + $username = isset($userInfos[1]) ? basename($userInfos[1], '.txt') : ''; + if (!file_exists(USERS_PATH . '/' . $username . '/config.php')) { + break; + } + + try { + Minz_Session::_param('currentUser', $username); + Minz_Configuration::register('user', + join_path(USERS_PATH, $username, 'config.php'), + join_path(USERS_PATH, '_', 'config.default.php')); + FreshRSS_Context::init(); + if ($feedController->actualizeAction($simplePie) > 0) { + $nb++; + } + } catch (Exception $e) { + logMe($e->getMessage()); + } +} + +$simplePie->__destruct(); +unset($simplePie); + +if ($nb === 0) { + header('HTTP/1.1 410 Gone'); + logMe('Nobody is subscribed to this feed anymore after all!: ' . $self); + die('Nobody is subscribed to this feed anymore after all!'); +} + +logMe($self . ' done: ' . $nb); +exit('Done: ' . $nb . "\n"); -- cgit v1.2.3 From 27d2b88a19345dfc665dc086d3c2b2e4547e1b7f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 23 May 2015 02:23:38 +0200 Subject: Minz getBaseUrl correction and RSS template bug https://github.com/FreshRSS/FreshRSS/issues/848 Corrections in Minz (HTTP_HOST was not sanitized, getURI() was never used and not working anyway with absolute base_url) $this->url was not defined in rss.phtml --- app/Controllers/indexController.php | 1 + constants.php | 3 ++- lib/Minz/Request.php | 46 +++++++++++-------------------------- lib/Minz/Url.php | 10 +------- 4 files changed, 18 insertions(+), 42 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index c1aaca53f..baaf99065 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -137,6 +137,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { } // No layout for RSS output. + $this->view->url = empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']; $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); $this->view->_useLayout(false); header('Content-Type: application/rss+xml; charset=utf-8'); diff --git a/constants.php b/constants.php index b20bf0710..d32fdfa9b 100644 --- a/constants.php +++ b/constants.php @@ -11,7 +11,8 @@ define('PHP_COMPRESSION', false); define('FRESHRSS_PATH', dirname(__FILE__)); define('PUBLIC_PATH', FRESHRSS_PATH . '/p'); - define('INDEX_PATH', PUBLIC_PATH . '/i'); + define('PUBLIC_TO_INDEX_PATH', '/i'); + define('INDEX_PATH', PUBLIC_PATH . PUBLIC_TO_INDEX_PATH); define('PUBLIC_RELATIVE', '..'); define('DATA_PATH', FRESHRSS_PATH . '/data'); diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 6db2e9c7a..b9eda82a5 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -84,45 +84,27 @@ class Minz_Request { self::magicQuotesOff(); } - /** - * Retourn le nom de domaine du site - */ - public static function getDomainName() { - return $_SERVER['HTTP_HOST']; - } - /** * Détermine la base de l'url * @return la base de l'url */ - public static function getBaseUrl() { + public static function getBaseUrl($baseUrlSuffix = '') { $conf = Minz_Configuration::get('system'); - $defaultBaseUrl = $conf->base_url; - if (!empty($defaultBaseUrl)) { - return $defaultBaseUrl; - } elseif (isset($_SERVER['REQUEST_URI'])) { - return dirname($_SERVER['REQUEST_URI']) . '/'; - } else { - return '/'; - } - } - - /** - * Récupère l'URI de la requête - * @return l'URI - */ - public static function getURI() { - if (isset($_SERVER['REQUEST_URI'])) { - $base_url = self::getBaseUrl(); - $uri = $_SERVER['REQUEST_URI']; - - $len_base_url = strlen($base_url); - $real_uri = substr($uri, $len_base_url); + $url = $conf->base_url; + if ($url == '' || !preg_match('%^https?://%i', $url)) { + $url = 'http'; + $host = empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']; + $port = empty($_SERVER['SERVER_PORT']) ? 80 : $_SERVER['SERVER_PORT']; + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') { + $url .= 's://' . $host . ($port == 443 ? '' : ':' . $port); + } else { + $url .= '://' . $host . ($port == 80 ? '' : ':' . $port); + } + $url .= isset($_SERVER['REQUEST_URI']) ? dirname($_SERVER['REQUEST_URI']) : ''; } else { - $real_uri = ''; + $url = rtrim($url, '/\\') . $baseUrlSuffix; } - - return $real_uri; + return filter_var($url . '/', FILTER_SANITIZE_URL); } /** diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php index af555a277..a47d8f1a6 100644 --- a/lib/Minz/Url.php +++ b/lib/Minz/Url.php @@ -10,7 +10,6 @@ class Minz_Url { * $url['c'] = controller * $url['a'] = action * $url['params'] = tableau des paramètres supplémentaires - * $url['protocol'] = protocole à utiliser (http par défaut) * ou comme une chaîne de caractère * @param $encodage pour indiquer comment encoder les & (& ou & pour html) * @return l'url formatée @@ -25,14 +24,7 @@ class Minz_Url { $url_string = ''; if ($absolute) { - if ($isArray && isset ($url['protocol'])) { - $protocol = $url['protocol']; - } elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { - $protocol = 'https:'; - } else { - $protocol = 'http:'; - } - $url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl (); + $url_string = Minz_Request::getBaseUrl(PUBLIC_TO_INDEX_PATH); } else { $url_string = $isArray ? '.' : PUBLIC_RELATIVE; } -- cgit v1.2.3 From 6e6746e090bfa11d1bdc1b39a0ecc144b8a5e9ff Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 30 May 2015 19:37:26 +0200 Subject: Version 1.1.1-dev --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index d32fdfa9b..dacd9dcdd 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Thu, 30 Jul 2015 16:20:04 +0200 Subject: Prepare next version 1.1.3-beta --- CHANGELOG.md | 5 +++++ constants.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index f50b88060..c89b52790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2015-08-31 FreshRSS 1.1.3-beta + +Nothing for the moment. + + ## 2015-07-30 FreshRSS 1.1.2-beta * Features diff --git a/constants.php b/constants.php index d5f0cc06b..dbc594fc3 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 12 Sep 2015 19:08:38 +0200 Subject: Prepare version 1.1.4-dev --- CHANGELOG.md | 3 +++ constants.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index be2813d30..273372192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2015-xx-xx FreshRSS 1.1.4-beta + + ## 2015-09-12 FreshRSS 1.1.3-beta * UI diff --git a/constants.php b/constants.php index dbc594fc3..0035c259b 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Mon, 2 Nov 2015 20:20:40 +0100 Subject: Move auto-update server URL in configuration Fix https://github.com/FreshRSS/FreshRSS/issues/1019 --- app/Controllers/updateController.php | 5 +++-- constants.php | 1 - data/config.default.php | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 84a33fe85..64c984b04 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -53,7 +53,8 @@ class FreshRSS_update_Controller extends Minz_ActionController { return; } - $c = curl_init(FRESHRSS_UPDATE_WEBSITE); + $auto_update_url = FreshRSS_Context::$system_conf->auto_update_url . '?v=' . FRESHRSS_VERSION; + $c = curl_init($auto_update_url); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); @@ -70,7 +71,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { $this->view->message = array( 'status' => 'bad', 'title' => _t('gen.short.damn'), - 'body' => _t('feedback.update.server_not_found', FRESHRSS_UPDATE_WEBSITE) + 'body' => _t('feedback.update.server_not_found', $auto_update_url) ); return; } diff --git a/constants.php b/constants.php index 0035c259b..1c50d4a83 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,6 @@ '', + # Specify address of the FreshRSS auto-update server. + 'auto_update_url' => 'https://update.freshrss.org', + # Natural language of the user interface, e.g. `en`, `fr`. 'language' => 'en', -- cgit v1.2.3 From ca6ca218dca17c3806191f72fa2b3fe02acc1692 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 4 Nov 2015 20:26:47 +0100 Subject: Version 1.2.0 --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 1c50d4a83..aa259f6c3 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Wed, 4 Nov 2015 21:44:08 +0100 Subject: Start 1.3.1-dev version --- CHANGELOG.md | 4 ++++ constants.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 167c5a29e..2c2d7f4cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2015-xx-xx FreshRSS 1.3.1-beta + +* Nothing for the moment. + ## 2015-11-03 FreshRSS 1.2.0 / 1.3.0-beta * Features diff --git a/constants.php b/constants.php index 1c50d4a83..a501d0df5 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Fri, 11 Mar 2016 22:35:21 +0100 Subject: Prepare release 1.3.1-beta https://github.com/FreshRSS/FreshRSS/issues/1113 --- CHANGELOG.md | 2 +- constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 233d9bdba..5e80b43ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2016-03-xx FreshRSS 1.3.1-beta +## 2016-03-11 FreshRSS 1.3.1-beta * Security * Added CSP `Content-Security-Policy: default-src 'self'; child-src *; frame-src *; img-src * data:; media-src *` [#1075](https://github.com/FreshRSS/FreshRSS/issues/1075), [#1114](https://github.com/FreshRSS/FreshRSS/issues/1114) diff --git a/constants.php b/constants.php index a501d0df5..a279534e3 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 12 Mar 2016 12:23:04 +0100 Subject: Start 1.3.2-dev version --- CHANGELOG.md | 5 +++++ constants.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e80b43ed..112d487b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2016-XX-YY FreshRSS 1.3.2-beta + +Nothing for the moment + + ## 2016-03-11 FreshRSS 1.3.1-beta * Security diff --git a/constants.php b/constants.php index a279534e3..2cf0f5bf4 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sun, 12 Jun 2016 12:42:50 +0200 Subject: Prepare for 1.3.2-beta --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 2cf0f5bf4..4bf99585f 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sun, 12 Jun 2016 22:27:04 +0200 Subject: Start next dev https://github.com/FreshRSS/FreshRSS/pull/1165 --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 4bf99585f..8d2708806 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 23 Jul 2016 17:12:10 +0200 Subject: Version 1.4.0 --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 4bf99585f..44e68c13c 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 23 Jul 2016 17:37:32 +0200 Subject: Prepare next dev version --- CHANGELOG.md | 5 +++++ constants.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f0eb4589..4d68e068a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## XXXX-XX-XX FreshRSS 1.5.0 + +Nothing yet. + + ## 2016-07-23 FreshRSS 1.4.0 ## 2016-06-12 FreshRSS 1.3.2-beta diff --git a/constants.php b/constants.php index 44e68c13c..8a6ce8a66 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Mon, 29 Aug 2016 19:46:41 +0200 Subject: Release version 1.5.0 --- CHANGELOG.md | 2 +- constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 93d3dcd3b..e8a06eac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2016-08-XX FreshRSS 1.5.0-dev +## 2016-08-29 FreshRSS 1.5.0 * Compatibility * Require at least MySQL 5.5.3+ [#1153](https://github.com/FreshRSS/FreshRSS/issues/1153) diff --git a/constants.php b/constants.php index 8a6ce8a66..80a22c8f0 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Wed, 31 Aug 2016 15:56:07 +0200 Subject: Start 1.6.0-dev --- CHANGELOG.md | 3 +++ constants.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a06eac0..1002873d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2016-XX-XX FreshRSS 1.6.0-dev + + ## 2016-08-29 FreshRSS 1.5.0 * Compatibility diff --git a/constants.php b/constants.php index 80a22c8f0..2a8486ad1 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sun, 30 Oct 2016 20:13:37 +0100 Subject: Prepare master 1.6.0 release https://github.com/FreshRSS/FreshRSS/issues/1328 --- CHANGELOG.md | 2 +- constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e89daf76..461949128 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2016-10-XX FreshRSS 1.6.0-dev +## 2016-10-30 FreshRSS 1.6.0 * CLI * New Command-Line Interface (CLI) [#1095](https://github.com/FreshRSS/FreshRSS/issues/1095) diff --git a/constants.php b/constants.php index 2a8486ad1..08268fdc3 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Wed, 2 Nov 2016 21:29:21 +0100 Subject: Use bindValue instead of bindParam https://github.com/FreshRSS/FreshRSS/issues/1349 We should later replace all bindParam by bindValue --- CHANGELOG.md | 6 ++++++ app/Models/EntryDAO.php | 2 +- constants.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 461949128..4be6d74bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2016-11-02 FreshRSS 1.6.1 + +* Bug fixing + * Fix regression introduced in 1.6.0 when refreshing articles with *Mark updated articles as unread* [#1349](https://github.com/FreshRSS/FreshRSS/issues/1349) + + ## 2016-10-30 FreshRSS 1.6.0 * CLI diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 4c6a9ea20..58f2c1a79 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -198,7 +198,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $valuesTmp['lastSeen'] = time(); $this->updateEntryPrepared->bindParam(':last_seen', $valuesTmp['lastSeen'], PDO::PARAM_INT); if ($valuesTmp['is_read'] !== null) { - $this->updateEntryPrepared->bindParam(':is_read', $valuesTmp['is_read'] ? 1 : 0, PDO::PARAM_INT); + $this->updateEntryPrepared->bindValue(':is_read', $valuesTmp['is_read'] ? 1 : 0, PDO::PARAM_INT); } $this->updateEntryPrepared->bindParam(':id_feed', $valuesTmp['id_feed'], PDO::PARAM_INT); $valuesTmp['tags'] = substr($valuesTmp['tags'], 0, 1023); diff --git a/constants.php b/constants.php index 08268fdc3..e5ae3ff00 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Thu, 3 Nov 2016 22:43:46 +0100 Subject: Start 1.7.0-dev --- CHANGELOG.md | 4 ++++ constants.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 4be6d74bd..77ec29aed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2016-xx-xx FreshRSS 1.7.0-dev + + + ## 2016-11-02 FreshRSS 1.6.1 * Bug fixing diff --git a/constants.php b/constants.php index e5ae3ff00..87cfb030b 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Wed, 21 Dec 2016 17:06:44 +0100 Subject: Prepare intermediate version 1.6.2 Mostly some bug fixes since 1.6.1 --- CHANGELOG.md | 4 +++- constants.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 6acb964e2..e812d70be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2016-xx-xx FreshRSS 1.7.0-dev +## 2016-12-xx FreshRSS 1.6.2-dev * Features * Add git compatibility in Web update system [#1357](https://github.com/FreshRSS/FreshRSS/issues/1357) @@ -12,8 +12,10 @@ * PostgreSQL: fix bug when updating cached values [#1360](https://github.com/FreshRSS/FreshRSS/issues/1360) * Fix bug in confirmation before marking as read [#1348](https://github.com/FreshRSS/FreshRSS/issues/1348) * Fix small bugs in installer [#1363](https://github.com/FreshRSS/FreshRSS/pull/1363) + * Allow slash in database hostname, when using sockets [#1364](https://github.com/FreshRSS/FreshRSS/issues/1364) * Misc. * More robust export function in the case of large datasets [#1372](https://github.com/FreshRSS/FreshRSS/issues/1372) + * Add a check for PHP extension fileinfo [#1375](https://github.com/FreshRSS/FreshRSS/issues/1375) ## 2016-11-02 FreshRSS 1.6.1 diff --git a/constants.php b/constants.php index 87cfb030b..2d934ec7c 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Mon, 26 Dec 2016 16:31:55 +0100 Subject: Version 1.6.2 --- CHANGELOG.md | 2 +- constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index d13912ae1..da73c285e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2016-12-xx FreshRSS 1.6.2-dev +## 2016-12-26 FreshRSS 1.6.2 * Features * Add git compatibility in Web update system [#1357](https://github.com/FreshRSS/FreshRSS/issues/1357) diff --git a/constants.php b/constants.php index 2d934ec7c..cb00839e2 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@