From 4058ff3ff4631bcc2c9cba534162c80db5cf2b65 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite 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 --- lib/lib_rss.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/lib_rss.php') 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 d651c41e0c30ee1d17c0c51faf4c69bece8210fd Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Thu, 16 Nov 2017 18:27:11 +0100 Subject: [FIX] #1690 - Also check pdo_pgsql extension in check_install() --- lib/lib_rss.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 7381ff2bd..dd0eb11f6 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -397,12 +397,13 @@ function is_referer_from_same_domain() { */ function check_install_php() { $pdo_mysql = extension_loaded('pdo_mysql'); + $pdo_pgsql = extension_loaded('pdo_pgsql'); $pdo_sqlite = extension_loaded('pdo_sqlite'); return array( 'php' => version_compare(PHP_VERSION, '5.3.8') >= 0, 'minz' => file_exists(LIB_PATH . '/Minz'), 'curl' => extension_loaded('curl'), - 'pdo' => $pdo_mysql || $pdo_sqlite, + 'pdo' => $pdo_mysql || $pdo_sqlite || $pdo_pgsql, 'pcre' => extension_loaded('pcre'), 'ctype' => extension_loaded('ctype'), 'fileinfo' => extension_loaded('fileinfo'), -- cgit v1.2.3 From aea78f4d99ff541cabc758033da1005022422fe3 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 1 Dec 2017 18:42:15 -0500 Subject: Call idn_to_ascii with INTL_IDNA_VARIANT_UTS46 Under PHP 7.2, calling `idn_to_ascii($idn)` results in a deprecation warning: 'INTL_IDNA_VARIANT_2003 is deprecated' See https://secure.php.net/manual/en/function.idn-to-ascii.php Therefore, if possible, `idn_to_ascii($idn, 0, INTL_IDNA_VARIANT_UTS46)` should be used instead. `INTL_IDNA_VARIANT_UTS46` was introduced in PHP 5.4, so on versions before that, `idn_to_ascii($idn)` must still be used. Fixed #1699 --- lib/lib_rss.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 09048700d..d62ab97a0 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -62,6 +62,12 @@ function idn_to_puny($url) { $parts = parse_url($url); if (!empty($parts['host'])) { $idn = $parts['host']; + // INTL_IDNA_VARIANT_UTS46 is defined starting in PHP 5.4 + if (defined('INTL_IDNA_VARIANT_UTS46')) { + $puny = idn_to_ascii($idn, 0, INTL_IDNA_VARIANT_UTS46); + } else { + $puny = idn_to_ascii($idn); + } $puny = idn_to_ascii($idn); $pos = strpos($url, $idn); if ($pos !== false) { -- cgit v1.2.3 From 1cf545342e4b89510fbd8517b638c6133d3e2c07 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 2 Dec 2017 14:03:19 +0100 Subject: Remove forgotten punycode line --- lib/lib_rss.php | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index d62ab97a0..8dfad7861 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -68,7 +68,6 @@ function idn_to_puny($url) { } else { $puny = idn_to_ascii($idn); } - $puny = idn_to_ascii($idn); $pos = strpos($url, $idn); if ($pos !== false) { return substr_replace($url, $puny, $pos, strlen($idn)); -- cgit v1.2.3 From 52d09886558361bd818182da9ddc204e83f618ba Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 11 Dec 2017 21:11:34 +0100 Subject: Use __DIR__ for relative include and require For uniformity, and to avoid having PHP searching in include_path. http://php.net/manual/function.include.php https://github.com/FreshRSS/FreshRSS/pull/1715 https://github.com/FreshRSS/FreshRSS/pull/1711#issuecomment-350581350 --- cli/_cli.php | 2 +- cli/_update-or-create-user.php | 2 +- cli/actualize-user.php | 2 +- cli/create-user.php | 2 +- cli/db-optimize.php | 2 +- cli/delete-user.php | 2 +- cli/do-install.php | 2 +- cli/export-opml-for-user.php | 2 +- cli/export-zip-for-user.php | 2 +- cli/import-for-user.php | 2 +- cli/list-users.php | 2 +- cli/reconfigure.php | 2 +- cli/update-user.php | 2 +- cli/user-info.php | 2 +- lib/lib_rss.php | 4 ++-- p/api/greader.php | 2 +- p/api/index.php | 2 +- p/api/pshb.php | 2 +- p/ext.php | 2 +- p/f.php | 2 +- p/i/index.php | 2 +- tests/bootstrap.php | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/cli/_cli.php b/cli/_cli.php index fb35c4afb..72629171c 100644 --- a/cli/_cli.php +++ b/cli/_cli.php @@ -3,7 +3,7 @@ if (php_sapi_name() !== 'cli') { die('FreshRSS error: This PHP script may only be invoked from command line!'); } -require(dirname(__FILE__) . '/../constants.php'); +require(__DIR__ . '/../constants.php'); require(LIB_PATH . '/lib_rss.php'); require(LIB_PATH . '/lib_install.php'); diff --git a/cli/_update-or-create-user.php b/cli/_update-or-create-user.php index 15397f1f6..a5960b58a 100644 --- a/cli/_update-or-create-user.php +++ b/cli/_update-or-create-user.php @@ -1,5 +1,5 @@ decode($var); @@ -12,7 +12,7 @@ if (!function_exists('json_decode')) { } if (!function_exists('json_encode')) { - require_once('JSON.php'); + require_once(__DIR__ . '/JSON.php'); function json_encode($var) { $JSON = new Services_JSON(); return $JSON->encodeUnsafe($var); diff --git a/p/api/greader.php b/p/api/greader.php index b27f5bd43..99304f4ec 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -20,7 +20,7 @@ Server-side API compatible with Google Reader API layer 2 * https://github.com/theoldreader/api */ -require('../../constants.php'); +require(__DIR__ . '/../../constants.php'); require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader $ORIGINAL_INPUT = file_get_contents('php://input', false, null, 0, 1048576); diff --git a/p/api/index.php b/p/api/index.php index 08f7b6b7b..429b25225 100644 --- a/p/api/index.php +++ b/p/api/index.php @@ -14,7 +14,7 @@
Your API address: