From 256c8613a4046931dcd28ab22b6aebe8752a98c2 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite 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) --- constants.php | 1 + 1 file changed, 1 insertion(+) (limited to 'constants.php') 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'); -- 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 @@ Date: Mon, 23 Jan 2017 10:33:36 +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 da73c285e..61b633329 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2017-xx-xx FreshRSS 1.7.0-dev + + + ## 2016-12-26 FreshRSS 1.6.2 * Features diff --git a/constants.php b/constants.php index cb00839e2..87cfb030b 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Thu, 23 Feb 2017 22:02:32 +0100 Subject: Prepare for intermediate version 1.6.3 https://github.com/FreshRSS/FreshRSS/milestone/22 --- 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 c9031c397..adbd0885b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2017-xx-xx FreshRSS 1.7.0-dev +## 2017-03-xx FreshRSS 1.6.3-dev * Features * Share with Ⓚnown [#1420](https://github.com/FreshRSS/FreshRSS/pull/1420) diff --git a/constants.php b/constants.php index 87cfb030b..184c9bbcb 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 11 Mar 2017 10:28:17 +0100 Subject: Prepare release 1.6.3 https://github.com/FreshRSS/FreshRSS/milestone/22 --- 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 a17692574..caed250ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2017-03-xx FreshRSS 1.6.3-dev +## 2017-03-11 FreshRSS 1.6.3 * Features * New option `disable_update` (also from CLI) to hide the system to update to new FreshRSS versions [#1436](https://github.com/FreshRSS/FreshRSS/pull/1436) diff --git a/constants.php b/constants.php index 184c9bbcb..7dd2238bf 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 11 Mar 2017 10:44:22 +0100 Subject: Prepare 1.6.4-dev Or maybe 1.7.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 caed250ca..7148bee98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2017-xx-xx FreshRSS 1.6.4-dev + + ## 2017-03-11 FreshRSS 1.6.3 * Features diff --git a/constants.php b/constants.php index 7dd2238bf..c6966fb7a 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sun, 26 Mar 2017 19:05:40 +0200 Subject: Start 1.7.0-dev --- 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 7148bee98..9b25afdab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2017-xx-xx FreshRSS 1.6.4-dev +## 2017-xx-xx FreshRSS 1.7.0-dev ## 2017-03-11 FreshRSS 1.6.3 diff --git a/constants.php b/constants.php index c6966fb7a..87cfb030b 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 3 Jun 2017 15:13:26 +0200 Subject: Final changes 1.7.0 https://github.com/FreshRSS/FreshRSS/pull/1564 https://github.com/FreshRSS/FreshRSS/pull/1559 --- 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 2bda85ca7..620bccc92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2017-xx-xx FreshRSS 1.7.0-dev +## 2017-06-03 FreshRSS 1.7.0 * Features: * Deferred insertion of new articles, for better chronological order [#530](https://github.com/FreshRSS/FreshRSS/issues/530) * Better search: @@ -24,10 +24,12 @@ * Change load order of CSS and JS to help CustomCSS and CustomJS extensions [Extensions#13](https://github.com/FreshRSS/Extensions/issues/13), [#1547](https://github.com/FreshRSS/FreshRSS/pull/1547) * UI * New option for not closing the article when clicking outside its area [#1539](https://github.com/FreshRSS/FreshRSS/pull/1539) + * Add shortcut in reader view to open the original page [#1564](https://github.com/FreshRSS/FreshRSS/pull/1564) * Download icon 💾 for other MIME types (e.g. `application/*`) [#1522](https://github.com/FreshRSS/FreshRSS/pull/1522) * I18n * Simplified Chinese [#1541](https://github.com/FreshRSS/FreshRSS/pull/1541) * Improve English [#1465](https://github.com/FreshRSS/FreshRSS/pull/1465) + * Improve Dutch [#1559](https://github.com/FreshRSS/FreshRSS/pull/1559) * Security * Do not require write access to check availability of new versions [#1450](https://github.com/FreshRSS/FreshRSS/issues/1450) * Misc. diff --git a/constants.php b/constants.php index 87cfb030b..ef60baea0 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Thu, 8 Jun 2017 19:35:18 +0200 Subject: Prepare next version Will be 1.7.1 or 1.8 --- 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 620bccc92..21459f32d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2017-XX-XX FreshRSS 1.7.1-dev + + ## 2017-06-03 FreshRSS 1.7.0 * Features: * Deferred insertion of new articles, for better chronological order [#530](https://github.com/FreshRSS/FreshRSS/issues/530) diff --git a/constants.php b/constants.php index ef60baea0..6819e8d2d 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Tue, 26 Sep 2017 22:20:25 +0200 Subject: Update some HTTP links (doc, HTTPS) (#1641) https://github.com/FreshRSS/FreshRSS/issues/1605 --- CREDITS.md | 4 ++-- README.fr.md | 7 +++---- README.md | 5 ++--- constants.php | 4 ++-- docs/en/developers/03_Backend/05_Extensions.md | 2 +- docs/fr/developers/02_Github.md | 2 +- docs/fr/developers/03_Backend/05_Extensions.md | 2 +- lib/lib_date.php | 2 +- p/api/greader.php | 4 ++-- p/themes/base-theme/README.md | 2 +- 10 files changed, 16 insertions(+), 18 deletions(-) (limited to 'constants.php') diff --git a/CREDITS.md b/CREDITS.md index 514464265..17fc490ab 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -7,7 +7,7 @@ People are sorted by name so please keep this order. --- * [Adrien Dorsaz](https://github.com/Trim): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Trim), [Web](https://adorsaz.ch/) -* [Alexandre Alapetite](https://github.com/Alkarex): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Alkarex), [Web](http://alexandre.alapetite.fr/) +* [Alexandre Alapetite](https://github.com/Alkarex): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Alkarex), [Web](https://alexandre.alapetite.fr/) * [Alexis Degrugillier](https://github.com/aledeg): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=aledeg) * [Alwaysin](https://github.com/Alwaysin): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Alwaysin) * [Amaury Carrade](https://github.com/AmauryCarrade): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=AmauryCarrade), [Web](https://amaury.carrade.eu/) @@ -32,7 +32,7 @@ People are sorted by name so please keep this order. * [Luc Didry](https://github.com/ldidry): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=ldidry), [Web](https://www.fiat-tux.fr/) * [marcomrc](https://github.com/marcomrc): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=marcomrc) * [Marcus Rohrmoser](https://github.com/mro): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=mro), [Web](http://mro.name/~me) -* [Marien Fressinaud](https://github.com/marienfressinaud): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=marienfressinaud), [Web](http://marienfressinaud.fr/) +* [Marien Fressinaud](https://github.com/marienfressinaud): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=marienfressinaud), [Web](https://marienfressinaud.fr/) * [Melvyn Laïly](https://github.com/yaurthek): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=yaurthek), [Web](http://x2a.yt/) * [Nicolas Elie](https://github.com/nicolaselie): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=nicolaselie) * [Nicolas Lœuillet](https://github.com/nicosomb): [contributions](https://github.com/FreshRSS/documentation/commits?author=nicosomb), [Web](http://www.loeuillet.org/) diff --git a/README.fr.md b/README.fr.md index cc268dc5e..8f19b280a 100644 --- a/README.fr.md +++ b/README.fr.md @@ -10,7 +10,7 @@ Il supporte [PubSubHubbub](https://code.google.com/p/pubsubhubbub/) pour des not Il y a une API pour les clients (mobiles), ainsi qu’une [interface en ligne de commande](./cli/README.md). Enfin, il permet l’ajout d’[extensions](#extensions) pour encore plus de personnalisation. -* Site officiel : http://freshrss.org +* Site officiel : https://freshrss.org * Démo : http://demo.freshrss.org/ * Licence : [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) @@ -42,8 +42,7 @@ Nous sommes une communauté amicale. ![Capture d’écran de FreshRSS](./docs/img/FreshRSS-screenshot.png) # Documentation -* http://doc.freshrss.org/fr/ -* https://github.com/FreshRSS/documentation +* https://freshrss.github.io/FreshRSS/fr/ # Installation 1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](../releases) @@ -156,7 +155,7 @@ Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensio # Bibliothèques incluses * [SimplePie](http://simplepie.org/) * [MINZ](https://github.com/marienfressinaud/MINZ) -* [php-http-304](http://alexandre.alapetite.fr/doc-alex/php-http-304/) +* [php-http-304](https://alexandre.alapetite.fr/doc-alex/php-http-304/) * [jQuery](http://jquery.com/) * [lib_opml](https://github.com/marienfressinaud/lib_opml) * [jQuery Plugin Sticky-Kit](http://leafo.net/sticky-kit/) diff --git a/README.md b/README.md index 016794ffc..14ca65a51 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,7 @@ We are a friendly community. ![FreshRSS screenshot](./docs/img/FreshRSS-screenshot.png) # Documentation -* http://doc.freshrss.org/en/ -* https://github.com/FreshRSS/documentation +* https://freshrss.github.io/FreshRSS/en/ # Installation 1. Get FreshRSS with git or [by downloading the archive](https://github.com/FreshRSS/FreshRSS/archive/master.zip) @@ -160,7 +159,7 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E # Included libraries * [SimplePie](http://simplepie.org/) * [MINZ](https://github.com/marienfressinaud/MINZ) -* [php-http-304](http://alexandre.alapetite.fr/doc-alex/php-http-304/) +* [php-http-304](https://alexandre.alapetite.fr/doc-alex/php-http-304/) * [jQuery](http://jquery.com/) * [lib_opml](https://github.com/marienfressinaud/lib_opml) * [jQuery Plugin Sticky-Kit](http://leafo.net/sticky-kit/) diff --git a/constants.php b/constants.php index 6819e8d2d..792c39df7 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,7 @@ Date: Sun, 1 Oct 2017 18:22:06 +0200 Subject: Prepare release of version 1.8.0 (#1649) https://github.com/FreshRSS/FreshRSS/milestone/24 --- 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 804631b7f..9dbdbe960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2017-XX-XX FreshRSS 1.7.1-dev +## 2017-10-01 FreshRSS 1.8.0 * Compatibility: * Minimal PHP version increased to PHP 5.3.8+ to fix sanitize bug [#1604](https://github.com/FreshRSS/FreshRSS/issues/1604) diff --git a/constants.php b/constants.php index 792c39df7..be70188e0 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sun, 1 Oct 2017 18:37:09 +0200 Subject: Prepare future version 1.8.1 --- 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 9dbdbe960..6c364a5af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2017-1X-XX FreshRSS 1.8.1-dev + + ## 2017-10-01 FreshRSS 1.8.0 * Compatibility: diff --git a/constants.php b/constants.php index be70188e0..195c7e073 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 7 Oct 2017 13:51:45 +0200 Subject: Remove SimplePie name from HTTP User-Agent string https://github.com/FreshRSS/FreshRSS/issues/1622#issuecomment-334928486 https://github.com/FreshRSS/FreshRSS/issues/1627 https://github.com/FreshRSS/FreshRSS/issues/1607 --- CHANGELOG.md | 8 +++++--- app/Models/Feed.php | 2 +- constants.php | 2 ++ lib/favicons.php | 2 +- lib/lib_rss.php | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b73bc2c8..09a644478 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,15 @@ ## 2017-1X-XX FreshRSS 1.8.1-dev +* SimplePie + * Remove "SimplePie" name from HTTP User-Agent string [#1656](https://github.com/FreshRSS/FreshRSS/pull/1656) * Misc. * Travis translation validation tool [#1653](https://github.com/FreshRSS/FreshRSS/pull/1653) ## 2017-10-01 FreshRSS 1.8.0 -* Compatibility: +* Compatibility * Minimal PHP version increased to PHP 5.3.8+ to fix sanitize bug [#1604](https://github.com/FreshRSS/FreshRSS/issues/1604) * Add support for PHP 7.1 in the API [#1584](https://github.com/FreshRSS/FreshRSS/issues/1584), [#1594](https://github.com/FreshRSS/FreshRSS/pull/1594) * UI @@ -36,7 +38,7 @@ ## 2017-06-03 FreshRSS 1.7.0 -* Features: +* Features * Deferred insertion of new articles, for better chronological order [#530](https://github.com/FreshRSS/FreshRSS/issues/530) * Better search: * Possibility to use multiple `intitle:`, `inurl:`, `author:` [#1478](https://github.com/FreshRSS/FreshRSS/pull/1478) @@ -44,7 +46,7 @@ * Examples: `!intitle:unwanted`, `-intitle:unwanted`, `-inurl:unwanted`, `-author:unwanted`, `-#unwanted`, `-unwanted` * Allow double-quotes, such as `author:"some name"`, in addition to single-quotes such as `author:'some name'` [#1478](https://github.com/FreshRSS/FreshRSS/pull/1478) * Multi-user tokens (to access RSS outputs of any user) [#1390](https://github.com/FreshRSS/FreshRSS/issues/1390) -* Compatibility: +* Compatibility * Add support for PHP 7.1 [#1471](https://github.com/FreshRSS/FreshRSS/issues/1471) * PostgreSQL is not experimental anymore [#1476](https://github.com/FreshRSS/FreshRSS/pull/1476) * Bug fixing diff --git a/app/Models/Feed.php b/app/Models/Feed.php index d8fe03197..44d518a47 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -484,7 +484,7 @@ class FreshRSS_Feed extends Minz_Model { CURLOPT_URL => $hubJson['hub'], CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, - CURLOPT_USERAGENT => 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')', + CURLOPT_USERAGENT => FRESHRSS_USERAGENT, CURLOPT_POSTFIELDS => http_build_query(array( 'hub.verify' => 'sync', 'hub.mode' => $state ? 'subscribe' : 'unsubscribe', diff --git a/constants.php b/constants.php index 195c7e073..9c647eb74 100644 --- a/constants.php +++ b/constants.php @@ -3,6 +3,8 @@ define('FRESHRSS_VERSION', '1.8.1-dev'); define('FRESHRSS_WEBSITE', 'https://freshrss.org'); define('FRESHRSS_WIKI', 'https://freshrss.github.io/FreshRSS/'); +define('FRESHRSS_USERAGENT', 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')'); + // PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) define('PHP_COMPRESSION', false); diff --git a/lib/favicons.php b/lib/favicons.php index a7ed966a1..80246ee74 100644 --- a/lib/favicons.php +++ b/lib/favicons.php @@ -35,7 +35,7 @@ function downloadHttp(&$url, $curlOptions = array()) { CURLOPT_MAXREDIRS => 10, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 15, - CURLOPT_USERAGENT => 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')', + CURLOPT_USERAGENT => FRESHRSS_USERAGENT, )); if (defined('CURLOPT_ENCODING')) { curl_setopt($ch, CURLOPT_ENCODING, ''); //Enable all encodings diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 09048700d..7381ff2bd 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -174,7 +174,7 @@ function customSimplePie() { $system_conf = Minz_Configuration::get('system'); $limits = $system_conf->limits; $simplePie = new SimplePie(); - $simplePie->set_useragent('FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); + $simplePie->set_useragent(FRESHRSS_USERAGENT); $simplePie->set_syslog($system_conf->simplepie_syslog_enabled); $simplePie->set_cache_location(CACHE_PATH); $simplePie->set_cache_duration($limits['cache_duration']); -- cgit v1.2.3 From 452886ea3ac4b91bc72952df659fb53ae7807c22 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sat, 9 Dec 2017 13:52:05 +0100 Subject: incorporated code review feedback --- constants.php | 3 +++ lib/Minz/Log.php | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 9c647eb74..b48c1be96 100644 --- a/constants.php +++ b/constants.php @@ -8,6 +8,9 @@ define('FRESHRSS_USERAGENT', 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; // PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) define('PHP_COMPRESSION', false); +// maximum log file size, before it will be purged (defaults to 512000 = 500kB) +define('MAX_LOG_SIZE', 512000); + // Constantes de chemins define('FRESHRSS_PATH', dirname(__FILE__)); diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index f7029f47d..6231754fa 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -20,8 +20,6 @@ class Minz_Log { const NOTICE = 8; const DEBUG = 16; - const MAX_LOG_SIZE = 512000; // 500kB - /** * Enregistre un message dans un fichier de log spécifique * Message non loggué si @@ -91,8 +89,9 @@ class Minz_Log { * @throws Minz_PermissionDeniedException */ protected static function checkLogfileSize($file_name) { - if (file_exists($file_name) && filesize($file_name) > self::MAX_LOG_SIZE) { - if (!unlink($file_name)) { + $maxSize = defined('MAX_LOG_SIZE') ? MAX_LOG_SIZE : 512000; + if (@filesize($file_name) > $maxSize) { + if (file_put_contents($file_name, '') === false) { throw new Minz_PermissionDeniedException($file_name, Minz_Exception::ERROR); } } -- cgit v1.2.3 From b1c317a253445a6458f1263c1b622a788cc7cd0e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 10 Dec 2017 21:31:41 +0100 Subject: Log rotation, use Minz_Log, new log constants ADMIN_LOG, API_LOG, PSHB_LOG --- app/Controllers/feedController.php | 4 ++-- app/Models/Feed.php | 14 +++++------- app/Models/LogDAO.php | 6 ++--- app/actualize_script.php | 13 ++++------- constants.php | 7 ++++-- lib/Minz/Log.php | 22 ++++++++++++++---- p/api/greader.php | 47 +++++++++----------------------------- p/api/pshb.php | 40 +++++++++++++++----------------- 8 files changed, 66 insertions(+), 87 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 45cba9e98..883f7af05 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -263,7 +263,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { if ((!$simplePiePush) && (!$feed_id) && $pubSubHubbubEnabled && ($feed->lastUpdate() > $pshbMinAge)) { //$text = 'Skip pull of feed using PubSubHubbub: ' . $url; //Minz_Log::debug($text); - //file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + //Minz_Log::debug($text, PSHB_LOG); continue; //When PubSubHubbub is used, do not pull refresh so often } @@ -371,7 +371,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { if ($pubSubHubbubEnabled && !$simplePiePush) { //We use push, but have discovered an article by pull! $text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' . $url . ' GUID ' . $entry->guid(); - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + Minz_Log::warning($text, PSHB_LOG); Minz_Log::warning($text); $pubSubHubbubEnabled = false; $feed->pubSubHubbubError(true); diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 85273d3f7..75d9f6d6f 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -403,8 +403,7 @@ class FreshRSS_Feed extends Minz_Model { if (!isset($hubJson['error']) || $hubJson['error'] !== (bool)$error) { $hubJson['error'] = (bool)$error; file_put_contents($hubFilename, json_encode($hubJson)); - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" - . 'Set error to ' . ($error ? 1 : 0) . ' for ' . $url . "\n", FILE_APPEND); + Minz_Log::warning('Set error to ' . ($error ? 1 : 0) . ' for ' . $url, PSHB_LOG); } return false; } @@ -419,7 +418,7 @@ class FreshRSS_Feed extends Minz_Model { if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key'])) { $text = 'Invalid JSON for PubSubHubbub: ' . $this->url; Minz_Log::warning($text); - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + Minz_Log::warning($text, PSHB_LOG); return false; } if ((!empty($hubJson['lease_end'])) && ($hubJson['lease_end'] < (time() + (3600 * 23)))) { //TODO: Make a better policy @@ -427,7 +426,7 @@ class FreshRSS_Feed extends Minz_Model { . date('c', empty($hubJson['lease_end']) ? time() : $hubJson['lease_end']) . ' and needs renewal: ' . $this->url; Minz_Log::warning($text); - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + Minz_Log::warning($text, PSHB_LOG); $key = $hubJson['key']; //To renew our lease } elseif (((!empty($hubJson['error'])) || empty($hubJson['lease_end'])) && (empty($hubJson['lease_start']) || $hubJson['lease_start'] < time() - (3600 * 23))) { //Do not renew too often @@ -445,7 +444,7 @@ class FreshRSS_Feed extends Minz_Model { file_put_contents(PSHB_PATH . '/keys/' . $key . '.txt', base64url_encode($this->selfUrl)); $text = 'PubSubHubbub prepared for ' . $this->url; Minz_Log::debug($text); - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + Minz_Log::debug($text, PSHB_LOG); } $currentUser = Minz_Session::param('currentUser'); if (FreshRSS_user_Controller::checkUsername($currentUser) && !file_exists($path . '/' . $currentUser . '.txt')) { @@ -499,9 +498,8 @@ class FreshRSS_Feed extends Minz_Model { $response = curl_exec($ch); $info = curl_getinfo($ch); - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . - 'PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $url . - ' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response . "\n", FILE_APPEND); + Minz_Log::warning('PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $url . + ' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response, PSHB_LOG); if (substr($info['http_code'], 0, 1) == '2') { return true; diff --git a/app/Models/LogDAO.php b/app/Models/LogDAO.php index ab258cd58..5bce466d5 100644 --- a/app/Models/LogDAO.php +++ b/app/Models/LogDAO.php @@ -22,9 +22,9 @@ class FreshRSS_LogDAO { public static function truncate() { file_put_contents(join_path(DATA_PATH, 'users', Minz_Session::param('currentUser', '_'), 'log.txt'), ''); if (FreshRSS_Auth::hasAccess('admin')) { - file_put_contents(join_path(DATA_PATH, 'users', '_', 'log.txt'), ''); - file_put_contents(join_path(DATA_PATH, 'users', '_', 'log_api.txt'), ''); - file_put_contents(join_path(DATA_PATH, 'users', '_', 'log_pshb.txt'), ''); + file_put_contents(ADMIN_LOG, ''); + file_put_contents(API_LOG, ''); + file_put_contents(PSHB_LOG, ''); } } } diff --git a/app/actualize_script.php b/app/actualize_script.php index deaa1bf7c..d4908d3ea 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -20,10 +20,6 @@ $_GET['ajax'] = 1; $_GET['force'] = true; $_SERVER['HTTP_HOST'] = ''; - -$log_file = join_path(USERS_PATH, '_', 'log.txt'); - - $app = new FreshRSS(); $system_conf = Minz_Configuration::get('system'); @@ -45,13 +41,13 @@ $min_last_activity = time() - $limits['max_inactivity']; foreach ($users as $user) { if (($user !== $system_conf->default_user) && (FreshRSS_UserDAO::mtime($user) < $min_last_activity)) { - Minz_Log::notice('FreshRSS skip inactive user ' . $user, $log_file); + Minz_Log::notice('FreshRSS skip inactive user ' . $user, ADMIN_LOG); if (defined('STDOUT')) { fwrite(STDOUT, 'FreshRSS skip inactive user ' . $user . "\n"); //Unbuffered } continue; } - Minz_Log::notice('FreshRSS actualize ' . $user, $log_file); + Minz_Log::notice('FreshRSS actualize ' . $user, ADMIN_LOG); if (defined('STDOUT')) { fwrite(STDOUT, 'Actualize ' . $user . "...\n"); //Unbuffered } @@ -66,8 +62,7 @@ foreach ($users as $user) { if (!invalidateHttpCache()) { - Minz_Log::notice('FreshRSS write access problem in ' . join_path(USERS_PATH, $user, 'log.txt'), - $log_file); + Minz_Log::warning('FreshRSS write access problem in ' . join_path(USERS_PATH, $user, 'log.txt'), ADMIN_LOG); if (defined('STDERR')) { fwrite(STDERR, 'Write access problem in ' . join_path(USERS_PATH, $user, 'log.txt') . "\n"); } @@ -75,7 +70,7 @@ foreach ($users as $user) { } -Minz_Log::notice('FreshRSS actualize done.', $log_file); +Minz_Log::notice('FreshRSS actualize done.', ADMIN_LOG); if (defined('STDOUT')) { fwrite(STDOUT, 'Done.' . "\n"); $end_date = date_create('now'); diff --git a/constants.php b/constants.php index b48c1be96..576be09b9 100644 --- a/constants.php +++ b/constants.php @@ -8,8 +8,8 @@ define('FRESHRSS_USERAGENT', 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; // PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) define('PHP_COMPRESSION', false); -// maximum log file size, before it will be purged (defaults to 512000 = 500kB) -define('MAX_LOG_SIZE', 512000); +// Maximum log file size in Bytes, before it will be divided by two +define('MAX_LOG_SIZE', 1048576); // Constantes de chemins define('FRESHRSS_PATH', dirname(__FILE__)); @@ -22,7 +22,10 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('DATA_PATH', FRESHRSS_PATH . '/data'); define('UPDATE_FILENAME', DATA_PATH . '/update.php'); define('USERS_PATH', DATA_PATH . '/users'); + define('ADMIN_LOG', USERS_PATH . '/_/log.txt'); + define('API_LOG', USERS_PATH . '/_/log_api.txt'); define('CACHE_PATH', DATA_PATH . '/cache'); + define('PSHB_LOG', USERS_PATH . '/_/log_pshb.txt'); define('PSHB_PATH', DATA_PATH . '/PubSubHubbub'); define('LIB_PATH', FRESHRSS_PATH . '/lib'); diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index 6231754fa..5e7831cdb 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -71,7 +71,7 @@ class Minz_Log { . ' [' . $level_label . ']' . ' --- ' . $information . "\n"; - self::checkLogfileSize($file_name); + self::ensureMaxLogSize($file_name); if (file_put_contents($file_name, $log, FILE_APPEND | LOCK_EX) === false) { throw new Minz_PermissionDeniedException($file_name, Minz_Exception::ERROR); @@ -88,12 +88,24 @@ class Minz_Log { * @param $file_name * @throws Minz_PermissionDeniedException */ - protected static function checkLogfileSize($file_name) { - $maxSize = defined('MAX_LOG_SIZE') ? MAX_LOG_SIZE : 512000; - if (@filesize($file_name) > $maxSize) { - if (file_put_contents($file_name, '') === false) { + protected static function ensureMaxLogSize($file_name) { + $maxSize = defined('MAX_LOG_SIZE') ? MAX_LOG_SIZE : 1048576; + if ($maxSize > 0 && @filesize($file_name) > $maxSize) { + $fp = fopen($file_name, 'c+'); + if ($fp && flock($fp, LOCK_EX)) { + fseek($fp, -intval($maxSize / 2), SEEK_END); + $content = fread($fp, $maxSize); + rewind($fp); + ftruncate($fp, 0); + fwrite($fp, $content ? $content : ''); + fflush($fp); + flock($fp, LOCK_UN); + } else { throw new Minz_PermissionDeniedException($file_name, Minz_Exception::ERROR); } + if ($fp) { + fclose($fp); + } } } diff --git a/p/api/greader.php b/p/api/greader.php index f086ee442..b27f5bd43 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -78,10 +78,6 @@ class MyPDO extends Minz_ModelPdo { } } -function logMe($text) { - file_put_contents(join_path(USERS_PATH, '_', 'log_api.txt'), date('c') . "\t" . $text . "\n", FILE_APPEND); -} - function debugInfo() { if (function_exists('getallheaders')) { $ALL_HEADERS = getallheaders(); @@ -107,16 +103,14 @@ function debugInfo() { } function badRequest() { - logMe("badRequest()"); - logMe(debugInfo()); + Minz_Log::warning('badRequest() ' . debugInfo(), API_LOG); header('HTTP/1.1 400 Bad Request'); header('Content-Type: text/plain; charset=UTF-8'); die('Bad Request!'); } function unauthorized() { - logMe("unauthorized()"); - logMe(debugInfo()); + Minz_Log::warning('unauthorized() ' . debugInfo(), API_LOG); header('HTTP/1.1 401 Unauthorized'); header('Content-Type: text/plain; charset=UTF-8'); header('Google-Bad-Token: true'); @@ -124,22 +118,21 @@ function unauthorized() { } function notImplemented() { - logMe("notImplemented()"); - logMe(debugInfo()); + Minz_Log::warning('notImplemented() ' . debugInfo(), API_LOG); header('HTTP/1.1 501 Not Implemented'); header('Content-Type: text/plain; charset=UTF-8'); die('Not Implemented!'); } function serviceUnavailable() { - logMe("serviceUnavailable()"); + Minz_Log::warning('serviceUnavailable() ' . debugInfo(), API_LOG); header('HTTP/1.1 503 Service Unavailable'); header('Content-Type: text/plain; charset=UTF-8'); die('Service Unavailable!'); } function checkCompatibility() { - logMe("checkCompatibility()"); + Minz_Log::warning('checkCompatibility() ' . debugInfo(), API_LOG); header('Content-Type: text/plain; charset=UTF-8'); if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) { die('FAIL 64-bit or GMP extension!'); @@ -170,7 +163,7 @@ function authorizationToUser() { if ($headerAuthX[1] === sha1(FreshRSS_Context::$system_conf->salt . $user . FreshRSS_Context::$user_conf->apiPasswordHash)) { return $user; } else { - logMe('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1]); + Minz_Log::warning('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1], API_LOG); Minz_Log::warning('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1]); unauthorized(); } @@ -183,7 +176,6 @@ function authorizationToUser() { } function clientLogin($email, $pass) { //http://web.archive.org/web/20130604091042/http://undoc.in/clientLogin.html - //logMe('clientLogin(' . $email . ")"); if (ctype_alnum($email)) { if (!function_exists('password_verify')) { include_once(LIB_PATH . '/password_compat.php'); @@ -215,7 +207,7 @@ function token($conf) { //http://blog.martindoms.com/2009/08/15/using-the-google-reader-api-part-1/ //https://github.com/ericmann/gReader-Library/blob/master/greader.class.php $user = Minz_Session::param('currentUser', '_'); - //logMe('token('. $user . ")"); //TODO: Implement real token that expires + //Minz_Log::debug('token('. $user . ')', API_LOG); //TODO: Implement real token that expires $token = str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters echo $token, "\n"; exit(); @@ -224,7 +216,6 @@ function token($conf) { function checkToken($conf, $token) { //http://code.google.com/p/google-reader-api/wiki/ActionToken $user = Minz_Session::param('currentUser', '_'); - //logMe('checkToken(' . $token . ")"); if ($token === str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) { return true; } @@ -232,7 +223,6 @@ function checkToken($conf, $token) { } function userInfo() { //https://github.com/theoldreader/api#user-info - //logMe("userInfo()"); $user = Minz_Session::param('currentUser', '_'); exit(json_encode(array( 'userId' => $user, @@ -243,7 +233,6 @@ function userInfo() { //https://github.com/theoldreader/api#user-info } function tagList() { - //logMe("tagList()"); header('Content-Type: application/json; charset=UTF-8'); $pdo = new MyPDO(); @@ -268,7 +257,6 @@ function tagList() { } function subscriptionList() { - //logMe("subscriptionList()"); header('Content-Type: application/json; charset=UTF-8'); $pdo = new MyPDO(); @@ -303,7 +291,6 @@ function subscriptionList() { } function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '') { - //logMe("subscriptionEdit()"); //https://github.com/mihaip/google-reader-api/blob/master/wiki/ApiSubscriptionEdit.wiki switch ($action) { case 'subscribe': @@ -360,7 +347,7 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' $feed = FreshRSS_feed_Controller::addFeed($streamName, $title, $addCatId, $c_name, $http_auth); continue; } catch (Exception $e) { - logMe("subscriptionEdit error subscribe: " . $e->getMessage()); + Minz_Log::error('subscriptionEdit error subscribe: ' . $e->getMessage(), API_LOG); } } badRequest(); @@ -389,7 +376,6 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' } function quickadd($url) { - //logMe("quickadd($url)"); try { $feed = FreshRSS_feed_Controller::addFeed($url); exit(json_encode(array( @@ -397,7 +383,7 @@ function quickadd($url) { 'streamId' => $feed->id(), ))); } catch (Exception $e) { - logMe("subscriptionEdit error subscribe: " . $e->getMessage()); + Minz_Log::error('quickadd error: ' . $e->getMessage(), API_LOG); die(json_encode(array( 'numResults' => 0, 'error' => $e->getMessage(), @@ -406,7 +392,6 @@ function quickadd($url) { } function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count - //logMe("unreadCount()"); header('Content-Type: application/json; charset=UTF-8'); $totalUnreads = 0; @@ -453,7 +438,6 @@ function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-googl function streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation) { //http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed - //logMe("streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation)"); header('Content-Type: application/json; charset=UTF-8'); $feedDAO = FreshRSS_Factory::createFeedDao(); @@ -562,8 +546,6 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude //http://code.google.com/p/google-reader-api/wiki/ApiStreamItemsIds //http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed - //logMe("streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target)"); - $type = 'A'; $id = ''; if ($streamId === 'user/-/state/com.google/reading-list') { @@ -610,8 +592,6 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude } function editTag($e_ids, $a, $r) { - //logMe("editTag()"); - foreach ($e_ids as $i => $e_id) { $e_ids[$i] = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/' } @@ -645,7 +625,6 @@ function editTag($e_ids, $a, $r) { } function renameTag($s, $dest) { - //logMe("renameTag()"); if ($s != '' && strpos($s, 'user/-/label/') === 0 && $dest != '' && strpos($dest, 'user/-/label/') === 0) { $s = substr($s, 13); @@ -661,7 +640,6 @@ function renameTag($s, $dest) { } function disableTag($s) { - //logMe("disableTag($s)"); if ($s != '' && strpos($s, 'user/-/label/') === 0) { $s = substr($s, 13); $categoryDAO = new FreshRSS_CategoryDAO(); @@ -679,7 +657,6 @@ function disableTag($s) { } function markAllAsRead($streamId, $olderThanId) { - //logMe("markAllAsRead($streamId, $olderThanId)"); $entryDAO = FreshRSS_Factory::createEntryDao(); if (strpos($streamId, 'feed/') === 0) { $f_id = basename($streamId); @@ -696,8 +673,8 @@ function markAllAsRead($streamId, $olderThanId) { exit('OK'); } -//logMe('----------------------------------------------------------------'); -//logMe(debugInfo()); +//Minz_Log::debug('----------------------------------------------------------------', API_LOG); +//Minz_Log::debug(debugInfo(), API_LOG); $pathInfo = empty($_SERVER['PATH_INFO']) ? '/Error' : urldecode($_SERVER['PATH_INFO']); $pathInfos = explode('/', $pathInfo); @@ -718,8 +695,6 @@ if ($user !== '') { FreshRSS_Context::$user_conf = get_user_configuration($user); } -//logMe('User => ' . $user); - Minz_Session::_param('currentUser', $user); if (count($pathInfos) < 3) { diff --git a/p/api/pshb.php b/p/api/pshb.php index ed8326cf5..578681cc4 100644 --- a/p/api/pshb.php +++ b/p/api/pshb.php @@ -2,18 +2,18 @@ require('../../constants.php'); require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader -define('MAX_PAYLOAD', 3145728); +const MAX_PAYLOAD = 3145728; header('Content-Type: text/plain; charset=UTF-8'); header('X-Content-Type-Options: nosniff'); -function logMe($text) { - file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); -} - $ORIGINAL_INPUT = file_get_contents('php://input', false, null, 0, MAX_PAYLOAD); -//logMe(print_r(array('_SERVER' => $_SERVER, '_GET' => $_GET, '_POST' => $_POST, 'INPUT' => $ORIGINAL_INPUT), true)); +Minz_Configuration::register('system', DATA_PATH . '/config.php', FRESHRSS_PATH . '/config.default.php'); +$system_conf = Minz_Configuration::get('system'); +$system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) + +//Minz_Log::debug(print_r(array('_SERVER' => $_SERVER, '_GET' => $_GET, '_POST' => $_POST, 'INPUT' => $ORIGINAL_INPUT), true), PSHB_LOG); $key = isset($_GET['k']) ? substr($_GET['k'], 0, 128) : ''; if (!ctype_xdigit($key)) { @@ -24,31 +24,31 @@ chdir(PSHB_PATH); $canonical64 = @file_get_contents('keys/' . $key . '.txt'); if ($canonical64 === false) { if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'unsubscribe') { - logMe('Warning: Accept unknown unsubscribe'); + Minz_Log::warning('Warning: Accept unknown unsubscribe', PSHB_LOG); header('Connection: close'); exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); } header('HTTP/1.1 404 Not Found'); - logMe('Warning: Feed key not found!: ' . $key); + Minz_Log::warning('Warning: Feed key not found!: ' . $key, PSHB_LOG); die('Feed key not found!'); } $canonical64 = trim($canonical64); if (!preg_match('/^[A-Za-z0-9_-]+$/D', $canonical64)) { header('HTTP/1.1 500 Internal Server Error'); - logMe('Error: Invalid key reference!: ' . $canonical64); + Minz_Log::error('Error: Invalid key reference!: ' . $canonical64, PSHB_LOG); die('Invalid key reference!'); } $hubFile = @file_get_contents('feeds/' . $canonical64 . '/!hub.json'); if ($hubFile === false) { header('HTTP/1.1 404 Not Found'); unlink('keys/' . $key . '.txt'); - logMe('Error: Feed info not found!: ' . $canonical64); + Minz_Log::error('Error: Feed info not found!: ' . $canonical64, PSHB_LOG); die('Feed info not found!'); } $hubJson = json_decode($hubFile, true); if (!$hubJson || empty($hubJson['key']) || $hubJson['key'] !== $key) { header('HTTP/1.1 500 Internal Server Error'); - logMe('Error: Invalid key cross-check!: ' . $key); + Minz_Log::error('Error: Invalid key cross-check!: ' . $key, PSHB_LOG); die('Invalid key cross-check!'); } chdir('feeds/' . $canonical64); @@ -56,7 +56,7 @@ $users = glob('*.txt', GLOB_NOSORT); if (empty($users)) { header('HTTP/1.1 410 Gone'); $url = base64url_decode($canonical64); - logMe('Warning: Nobody subscribes to this feed anymore!: ' . $url); + Minz_Log::warning('Warning: Nobody subscribes to this feed anymore!: ' . $url, PSHB_LOG); unlink('../../keys/' . $key . '.txt'); Minz_Configuration::register('system', DATA_PATH . '/config.php', @@ -101,10 +101,6 @@ if ($ORIGINAL_INPUT == '') { die('Missing XML payload!'); } -Minz_Configuration::register('system', DATA_PATH . '/config.php', FRESHRSS_PATH . '/config.default.php'); -$system_conf = Minz_Configuration::get('system'); -$system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) - $simplePie = customSimplePie(); $simplePie->set_raw_data($ORIGINAL_INPUT); $simplePie->init(); @@ -115,7 +111,7 @@ $self = isset($links[0]) ? $links[0] : null; if ($self !== base64url_decode($canonical64)) { //header('HTTP/1.1 422 Unprocessable Entity'); - logMe('Warning: Self URL [' . $self . '] does not match registered canonical URL!: ' . base64url_decode($canonical64)); + Minz_Log::warning('Warning: Self URL [' . $self . '] does not match registered canonical URL!: ' . base64url_decode($canonical64), PSHB_LOG); //die('Self URL does not match registered canonical URL!'); $self = base64url_decode($canonical64); } @@ -124,7 +120,7 @@ $nb = 0; foreach ($users as $userFilename) { $username = basename($userFilename, '.txt'); if (!file_exists(USERS_PATH . '/' . $username . '/config.php')) { - logMe('Warning: Removing broken user link: ' . $username . ' for ' . $self); + Minz_Log::warning('Warning: Removing broken user link: ' . $username . ' for ' . $self, PSHB_LOG); unlink($userFilename); continue; } @@ -140,11 +136,11 @@ foreach ($users as $userFilename) { if ($updated_feeds > 0 || $feed != false) { $nb++; } else { - logMe('Warning: User ' . $username . ' does not subscribe anymore to ' . $self); + Minz_Log::warning('Warning: User ' . $username . ' does not subscribe anymore to ' . $self, PSHB_LOG); unlink($userFilename); } } catch (Exception $e) { - logMe('Error: ' . $e->getMessage() . ' for user ' . $username . ' and feed ' . $self); + Minz_Log::error('Error: ' . $e->getMessage() . ' for user ' . $username . ' and feed ' . $self, PSHB_LOG); } } @@ -153,12 +149,12 @@ unset($simplePie); if ($nb === 0) { header('HTTP/1.1 410 Gone'); - logMe('Warning: Nobody subscribes to this feed anymore after all!: ' . $self); + Minz_Log::warning('Warning: Nobody subscribes to this feed anymore after all!: ' . $self, PSHB_LOG); die('Nobody subscribes to this feed anymore after all!'); } elseif (!empty($hubJson['error'])) { $hubJson['error'] = false; file_put_contents('./!hub.json', json_encode($hubJson)); } -logMe('PubSubHubbub ' . $self . ' done: ' . $nb); +Minz_Log::notice('PubSubHubbub ' . $self . ' done: ' . $nb, PSHB_LOG); exit('Done: ' . $nb . "\n"); -- cgit v1.2.3