diff options
| author | 2026-01-18 15:37:10 +0100 | |
|---|---|---|
| committer | 2026-01-18 15:37:10 +0100 | |
| commit | ff7ce7b21d158572e59951d5519a1cc7a1f0ce44 (patch) | |
| tree | 402563e5b4249bd20d4a6da2f446bc164bf0aeb0 | |
| parent | 2cbb5f8db1d0764aba9a66997f940739e8bb7eb1 (diff) | |
Bump SimplePie (#8445)
https://github.com/simplepie/simplepie/pull/957
| -rw-r--r-- | lib/composer.json | 2 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/.editorconfig | 4 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/.gitignore | 1 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/phpstan.dist.neon | 1 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/src/File.php | 5 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/src/HTTP/Parser.php | 4 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/src/Registry.php | 1 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/src/Sanitize.php | 6 | ||||
| -rw-r--r-- | lib/simplepie/simplepie/src/SimplePie.php | 7 |
9 files changed, 22 insertions, 9 deletions
diff --git a/lib/composer.json b/lib/composer.json index 1f2edfb57..f8150277c 100644 --- a/lib/composer.json +++ b/lib/composer.json @@ -14,7 +14,7 @@ "marienfressinaud/lib_opml": "0.5.1", "phpgt/cssxpath": "v1.4.0", "phpmailer/phpmailer": "7.0.1", - "simplepie/simplepie": "dev-freshrss#ecc7ef140142d0fc224128efb10b48322b5f707c" + "simplepie/simplepie": "dev-freshrss#dbcf155c82a17872f0bf8562723cc809842064ee" }, "config": { "sort-packages": true, diff --git a/lib/simplepie/simplepie/.editorconfig b/lib/simplepie/simplepie/.editorconfig index 7694fb7f7..a050185ad 100644 --- a/lib/simplepie/simplepie/.editorconfig +++ b/lib/simplepie/simplepie/.editorconfig @@ -19,6 +19,10 @@ indent_style = space max_line_length = off trim_trailing_whitespace = false +[*.neon] +indent_size = 4 +indent_style = space + [*.php] indent_size = 4 indent_style = space diff --git a/lib/simplepie/simplepie/.gitignore b/lib/simplepie/simplepie/.gitignore index 805c1f9b9..611895a6d 100644 --- a/lib/simplepie/simplepie/.gitignore +++ b/lib/simplepie/simplepie/.gitignore @@ -7,3 +7,4 @@ phpstan.neon phpunit.xml .php-cs-fixer.cache .phpunit.cache/ +.phpunit.result.cache diff --git a/lib/simplepie/simplepie/phpstan.dist.neon b/lib/simplepie/simplepie/phpstan.dist.neon index da1d19fc6..848a033a1 100644 --- a/lib/simplepie/simplepie/phpstan.dist.neon +++ b/lib/simplepie/simplepie/phpstan.dist.neon @@ -5,6 +5,7 @@ parameters: - library/ - src/ - tests/ + - utils/ ignoreErrors: # Ignore that only one const exists atm diff --git a/lib/simplepie/simplepie/src/File.php b/lib/simplepie/simplepie/src/File.php index 873509d54..6d03d4827 100644 --- a/lib/simplepie/simplepie/src/File.php +++ b/lib/simplepie/simplepie/src/File.php @@ -126,9 +126,10 @@ class File implements Response } else { curl_setopt($fp, CURLOPT_ENCODING, ''); } + /** @var non-empty-string $url */ curl_setopt($fp, CURLOPT_URL, $url); - curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($fp, CURLOPT_FAILONERROR, 1); + curl_setopt($fp, CURLOPT_RETURNTRANSFER, true); + curl_setopt($fp, CURLOPT_FAILONERROR, true); curl_setopt($fp, CURLOPT_TIMEOUT, $timeout); curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout); // curl_setopt($fp, CURLOPT_REFERER, \SimplePie\Misc::url_remove_credentials($url)); // FreshRSS removed diff --git a/lib/simplepie/simplepie/src/HTTP/Parser.php b/lib/simplepie/simplepie/src/HTTP/Parser.php index d329be1c2..55483f6ff 100644 --- a/lib/simplepie/simplepie/src/HTTP/Parser.php +++ b/lib/simplepie/simplepie/src/HTTP/Parser.php @@ -243,7 +243,7 @@ class Parser $headers[$name][] = $value; } else { // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough. - /** @var array<string, string>) */ + /** @var array<string,string> */ $headers = &$this->headers; $headers[$name] .= ', ' . $value; } @@ -258,7 +258,7 @@ class Parser $headers[$name] = [$value]; } else { // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough. - /** @var array<string, string>) */ + /** @var array<string,string> */ $headers = &$this->headers; $headers[$name] = $value; } diff --git a/lib/simplepie/simplepie/src/Registry.php b/lib/simplepie/simplepie/src/Registry.php index 228f8c33c..c02652bb8 100644 --- a/lib/simplepie/simplepie/src/Registry.php +++ b/lib/simplepie/simplepie/src/Registry.php @@ -125,7 +125,6 @@ class Registry return false; } - /** @var string */ $base_class = $this->default[$type]; if (!is_subclass_of($class, $base_class)) { diff --git a/lib/simplepie/simplepie/src/Sanitize.php b/lib/simplepie/simplepie/src/Sanitize.php index 9918a5171..dbcc6310e 100644 --- a/lib/simplepie/simplepie/src/Sanitize.php +++ b/lib/simplepie/simplepie/src/Sanitize.php @@ -759,6 +759,9 @@ class Sanitize implements RegistryAware if ($this->encode_instead_of_strip) { foreach ($elements as $element) { + if (!($element instanceof \DOMNode)) { + continue; + } $fragment = $document->createDocumentFragment(); // For elements which aren't script or style, include the tag itself @@ -815,6 +818,9 @@ class Sanitize implements RegistryAware return; } else { foreach ($elements as $element) { + if (!($element instanceof \DOMNode)) { + continue; + } $fragment = $document->createDocumentFragment(); $number = $element->childNodes->length; for ($i = $number; $i > 0; $i--) { diff --git a/lib/simplepie/simplepie/src/SimplePie.php b/lib/simplepie/simplepie/src/SimplePie.php index 38c61e841..d80174a38 100644 --- a/lib/simplepie/simplepie/src/SimplePie.php +++ b/lib/simplepie/simplepie/src/SimplePie.php @@ -1849,7 +1849,8 @@ class SimplePie $single_success = $this->multifeed_objects[$i]->init(); $success |= $single_success; if (!$single_success) { - $this->error[$i] = $this->multifeed_objects[$i]->error(); + $error = $this->multifeed_objects[$i]->error() ?? ''; + $this->error[$i] = is_string($error) ? $error : implode('; ', $error); } $i++; } @@ -1954,7 +1955,7 @@ class SimplePie // Cache the file if caching is enabled $this->data['cache_expiration_time'] = \SimplePie\HTTP\Utils::negociate_cache_expiration_time($this->data['headers'] ?? [], $this->cache_duration, $this->cache_duration_min, $this->cache_duration_max); - if ($cache && !$cache->set_data($this->get_cache_filename($this->feed_url), $this->data, $this->cache_duration)) { + if ($cache instanceof DataCache && !$cache->set_data($this->get_cache_filename($this->feed_url), $this->data, $this->cache_duration)) { trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); } return true; @@ -3066,7 +3067,7 @@ class SimplePie } // https://datatracker.ietf.org/doc/html/rfc8288 if (is_string($link_headers) && - preg_match_all('/<(?P<uri>[^>]+)>\s*;\s*rel\s*=\s*(?P<quote>"?)' . preg_quote($rel) . '(?P=quote)\s*(?=,|$)/i', $link_headers, $matches)) { + preg_match_all('/<(?P<uri>[^>]+)>\s*;\s*rel\s*=\s*(?P<quote>"?)' . preg_quote($rel, '/') . '(?P=quote)\s*(?=,|$)/i', $link_headers, $matches)) { return $matches['uri']; } } |
