A free, self-hostable news aggregator…
Remove SimplePie name from HTTP User-Agent string
Alexandre Alapetite4058ff3ff463
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 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 fixingdiff --git a/app/Models/Feed.php b/app/Models/Feed.phpindex 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.phpindex 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.phpindex 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 encodingsdiff --git a/lib/lib_rss.php b/lib/lib_rss.phpindex 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']);