diff options
| author | 2017-10-07 13:51:45 +0200 | |
|---|---|---|
| committer | 2017-10-07 13:51:45 +0200 | |
| commit | 4058ff3ff4631bcc2c9cba534162c80db5cf2b65 (patch) | |
| tree | 54b22178f371883779cb6fc59567e0bc7cf55870 | |
| parent | 9bbec9a1e8035555bec014bc26f7ef178daaf725 (diff) | |
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
| -rw-r--r-- | CHANGELOG.md | 8 | ||||
| -rw-r--r-- | app/Models/Feed.php | 2 | ||||
| -rw-r--r-- | constants.php | 2 | ||||
| -rw-r--r-- | lib/favicons.php | 2 | ||||
| -rw-r--r-- | lib/lib_rss.php | 2 |
5 files changed, 10 insertions, 6 deletions
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']); |
