A free, self-hostable news aggregator…
Manual update SimplePie (#4011)
Alexandre Alapetiteb21fe199ed19
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.phpindex 15b4dfea4..fbb0041f6 100644--- a/lib/SimplePie/SimplePie.php+++ b/lib/SimplePie/SimplePie.php@@ -2707,13 +2707,19 @@ class SimplePie}}- if (isset($this->data['headers']['link']) &&- preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/',- $this->data['headers']['link'], $match))+ if (isset($this->data['headers']['link'])){- return array($match[1]);+ $link_headers = $this->data['headers']['link'];+ if (is_string($link_headers)) {+ $link_headers = array($link_headers);+ }+ $matches = preg_filter('/<([^>]+)>; rel='.preg_quote($rel).'/', '$1', $link_headers);+ if (!empty($matches)) {+ return $matches;+ }}- else if (isset($this->data['links'][$rel]))++ if (isset($this->data['links'][$rel])){return $this->data['links'][$rel];}diff --git a/lib/SimplePie/SimplePie/Enclosure.php b/lib/SimplePie/SimplePie/Enclosure.phpindex 32216d848..8a4cffa30 100644--- a/lib/SimplePie/SimplePie/Enclosure.php+++ b/lib/SimplePie/SimplePie/Enclosure.php@@ -1152,7 +1152,12 @@ class SimplePie_Enclosure// If we encounter an unsupported mime-type, check the file extension and guess intelligently.if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))){- switch (strtolower($this->get_extension()))+ $extension = $this->get_extension();+ if ($extension === null) {+ return null;+ }++ switch (strtolower($extension)){// Audio mime-typescase 'aac':diff --git a/lib/SimplePie/SimplePie/HTTP/Parser.php b/lib/SimplePie/SimplePie/HTTP/Parser.phpindex 1dbe06c3e..a4c48ddb7 100644--- a/lib/SimplePie/SimplePie/HTTP/Parser.php+++ b/lib/SimplePie/SimplePie/HTTP/Parser.php@@ -507,11 +507,13 @@ class SimplePie_HTTP_Parser{$data = explode("\r\n\r\n", $headers, $count);$data = array_pop($data);- if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n\r\n")) {- $data = str_ireplace("HTTP/1.0 200 Connection established\r\n\r\n", '', $data);+ if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n")) {+ $exploded = explode("\r\n\r\n", $data, 2);+ $data = end($exploded);}- if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n\r\n")) {- $data = str_ireplace("HTTP/1.1 200 Connection established\r\n\r\n", '', $data);+ if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n")) {+ $exploded = explode("\r\n\r\n", $data, 2);+ $data = end($exploded);}return $data;}diff --git a/lib/SimplePie/SimplePie/Registry.php b/lib/SimplePie/SimplePie/Registry.phpindex bf3baf179..1aac51d07 100755--- a/lib/SimplePie/SimplePie/Registry.php+++ b/lib/SimplePie/SimplePie/Registry.php@@ -208,7 +208,8 @@ class SimplePie_Registry{case 'Cache':// For backwards compatibility with old non-static- // Cache::create() methods+ // Cache::create() methods in PHP < 8.0.+ // No longer supported as of PHP 8.0.if ($method === 'get_handler'){$result = @call_user_func_array(array($class, 'create'), $parameters);