aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2023-09-05 22:16:29 +0200
committerManuel Hiebel <leuhmanu@mageia.org>2023-09-05 22:16:29 +0200
commit02b6ced8955cd5b773e958cd12f586b69933b84f (patch)
treeabc29dc6dae1babf44e18d28ba397dbc94285730 /lib
parent4dc2c6193f1668d2bd6c9e7b4e6c9ccdcc6ac3a8 (diff)
downloadwww-02b6ced8955cd5b773e958cd12f586b69933b84f.tar
www-02b6ced8955cd5b773e958cd12f586b69933b84f.tar.gz
www-02b6ced8955cd5b773e958cd12f586b69933b84f.tar.bz2
www-02b6ced8955cd5b773e958cd12f586b69933b84f.tar.xz
www-02b6ced8955cd5b773e958cd12f586b69933b84f.zip
Update simplepie to try to fix mga#32236
Diffstat (limited to 'lib')
-rw-r--r--lib/simplepie/autoloader.php2
-rwxr-xr-xlib/simplepie/library/SimplePie.php42
-rw-r--r--lib/simplepie/library/SimplePie/Author.php2
-rw-r--r--lib/simplepie/library/SimplePie/Cache.php2
-rw-r--r--lib/simplepie/library/SimplePie/Cache/Base.php2
-rw-r--r--lib/simplepie/library/SimplePie/Cache/DB.php2
-rw-r--r--lib/simplepie/library/SimplePie/Cache/File.php2
-rw-r--r--lib/simplepie/library/SimplePie/Cache/Memcache.php2
-rwxr-xr-xlib/simplepie/library/SimplePie/Cache/Memcached.php2
-rw-r--r--lib/simplepie/library/SimplePie/Cache/MySQL.php4
-rw-r--r--lib/simplepie/library/SimplePie/Cache/Redis.php4
-rw-r--r--lib/simplepie/library/SimplePie/Caption.php2
-rw-r--r--lib/simplepie/library/SimplePie/Category.php3
-rw-r--r--lib/simplepie/library/SimplePie/Content/Type/Sniffer.php2
-rw-r--r--lib/simplepie/library/SimplePie/Copyright.php2
-rw-r--r--lib/simplepie/library/SimplePie/Credit.php2
-rw-r--r--lib/simplepie/library/SimplePie/Enclosure.php9
-rw-r--r--lib/simplepie/library/SimplePie/Exception.php4
-rw-r--r--lib/simplepie/library/SimplePie/File.php4
-rw-r--r--lib/simplepie/library/SimplePie/HTTP/Parser.php12
-rw-r--r--lib/simplepie/library/SimplePie/IRI.php2
-rw-r--r--lib/simplepie/library/SimplePie/Item.php2
-rw-r--r--lib/simplepie/library/SimplePie/Locator.php3
-rw-r--r--lib/simplepie/library/SimplePie/Misc.php12
-rw-r--r--lib/simplepie/library/SimplePie/Net/IPv6.php2
-rw-r--r--lib/simplepie/library/SimplePie/Parse/Date.php2
-rw-r--r--lib/simplepie/library/SimplePie/Parser.php2
-rw-r--r--lib/simplepie/library/SimplePie/Rating.php2
-rwxr-xr-xlib/simplepie/library/SimplePie/Registry.php5
-rw-r--r--lib/simplepie/library/SimplePie/Restriction.php2
-rw-r--r--lib/simplepie/library/SimplePie/Sanitize.php60
-rw-r--r--lib/simplepie/library/SimplePie/Source.php2
-rw-r--r--lib/simplepie/library/SimplePie/XML/Declaration/Parser.php2
-rw-r--r--lib/simplepie/library/SimplePie/gzdecode.php2
34 files changed, 181 insertions, 25 deletions
diff --git a/lib/simplepie/autoloader.php b/lib/simplepie/autoloader.php
index e42f07b3a..bf34a7003 100644
--- a/lib/simplepie/autoloader.php
+++ b/lib/simplepie/autoloader.php
@@ -58,6 +58,8 @@ if (!class_exists('SimplePie'))
*/
class SimplePie_Autoloader
{
+ protected $path;
+
/**
* Constructor
*/
diff --git a/lib/simplepie/library/SimplePie.php b/lib/simplepie/library/SimplePie.php
index d4c2f0f1d..2ae78c359 100755
--- a/lib/simplepie/library/SimplePie.php
+++ b/lib/simplepie/library/SimplePie.php
@@ -33,7 +33,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
- * @version 1.5.6
+ * @version 1.6.0
* @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue
* @author Ryan Parman
* @author Sam Sneddon
@@ -50,7 +50,7 @@ define('SIMPLEPIE_NAME', 'SimplePie');
/**
* SimplePie Version
*/
-define('SIMPLEPIE_VERSION', '1.5.6');
+define('SIMPLEPIE_VERSION', '1.6.0');
/**
* SimplePie Build
@@ -651,6 +651,13 @@ class SimplePie
public $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
/**
+ * @var array Stores the default attributes to be renamed by rename_attributes().
+ * @see SimplePie::rename_attributes()
+ * @access private
+ */
+ public $rename_attributes = array();
+
+ /**
* @var bool Should we throw exceptions, or use the old-style error property?
* @access private
*/
@@ -1223,6 +1230,15 @@ class SimplePie
$this->sanitize->encode_instead_of_strip($enable);
}
+ public function rename_attributes($attribs = '')
+ {
+ if ($attribs === '')
+ {
+ $attribs = $this->rename_attributes;
+ }
+ $this->sanitize->rename_attributes($attribs);
+ }
+
public function strip_attributes($attribs = '')
{
if ($attribs === '')
@@ -1785,7 +1801,7 @@ class SimplePie
}
/**
- * Get the error message for the occured error
+ * Get the error message for the occurred error
*
* @return string|array Error message, or array of messages for multifeeds
*/
@@ -2199,7 +2215,7 @@ class SimplePie
*/
public function get_base($element = array())
{
- if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base']))
+ if (!empty($element['xml_base_explicit']) && isset($element['xml_base']))
{
return $element['xml_base'];
}
@@ -2647,13 +2663,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];
}
@@ -3310,3 +3332,5 @@ class SimplePie
}
}
}
+
+class_alias('SimplePie', 'SimplePie\SimplePie', false);
diff --git a/lib/simplepie/library/SimplePie/Author.php b/lib/simplepie/library/SimplePie/Author.php
index 563932f4c..3baadee62 100644
--- a/lib/simplepie/library/SimplePie/Author.php
+++ b/lib/simplepie/library/SimplePie/Author.php
@@ -147,3 +147,5 @@ class SimplePie_Author
return null;
}
}
+
+class_alias('SimplePie_Author', 'SimplePie\Author', false);
diff --git a/lib/simplepie/library/SimplePie/Cache.php b/lib/simplepie/library/SimplePie/Cache.php
index 9c5577d95..88d811660 100644
--- a/lib/simplepie/library/SimplePie/Cache.php
+++ b/lib/simplepie/library/SimplePie/Cache.php
@@ -132,3 +132,5 @@ class SimplePie_Cache
return $params;
}
}
+
+class_alias('SimplePie_Cache', 'SimplePie\Cache', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/Base.php b/lib/simplepie/library/SimplePie/Cache/Base.php
index 522ff7e10..29eb0594b 100644
--- a/lib/simplepie/library/SimplePie/Cache/Base.php
+++ b/lib/simplepie/library/SimplePie/Cache/Base.php
@@ -111,3 +111,5 @@ interface SimplePie_Cache_Base
*/
public function unlink();
}
+
+class_alias('SimplePie_Cache_Base', 'SimplePie\Cache\Base', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/DB.php b/lib/simplepie/library/SimplePie/Cache/DB.php
index 74d57b8da..3dca8e5db 100644
--- a/lib/simplepie/library/SimplePie/Cache/DB.php
+++ b/lib/simplepie/library/SimplePie/Cache/DB.php
@@ -134,3 +134,5 @@ abstract class SimplePie_Cache_DB implements SimplePie_Cache_Base
return array(serialize($data->data), $items_by_id);
}
}
+
+class_alias('SimplePie_Cache_DB', 'SimplePie\Cache\DB', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/File.php b/lib/simplepie/library/SimplePie/Cache/File.php
index 03758e923..db30e7a0f 100644
--- a/lib/simplepie/library/SimplePie/Cache/File.php
+++ b/lib/simplepie/library/SimplePie/Cache/File.php
@@ -162,3 +162,5 @@ class SimplePie_Cache_File implements SimplePie_Cache_Base
return false;
}
}
+
+class_alias('SimplePie_Cache_File', 'SimplePie\Cache\File', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/Memcache.php b/lib/simplepie/library/SimplePie/Cache/Memcache.php
index caf785275..2cc37f907 100644
--- a/lib/simplepie/library/SimplePie/Cache/Memcache.php
+++ b/lib/simplepie/library/SimplePie/Cache/Memcache.php
@@ -178,3 +178,5 @@ class SimplePie_Cache_Memcache implements SimplePie_Cache_Base
return $this->cache->delete($this->name, 0);
}
}
+
+class_alias('SimplePie_Cache_Memcache', 'SimplePie\Cache\Memcache', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/Memcached.php b/lib/simplepie/library/SimplePie/Cache/Memcached.php
index 0b40d87c8..32a53eb7b 100755
--- a/lib/simplepie/library/SimplePie/Cache/Memcached.php
+++ b/lib/simplepie/library/SimplePie/Cache/Memcached.php
@@ -164,3 +164,5 @@ class SimplePie_Cache_Memcached implements SimplePie_Cache_Base
return false;
}
}
+
+class_alias('SimplePie_Cache_Memcached', 'SimplePie\Cache\Memcached', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/MySQL.php b/lib/simplepie/library/SimplePie/Cache/MySQL.php
index a684eb833..d21e2b6e4 100644
--- a/lib/simplepie/library/SimplePie/Cache/MySQL.php
+++ b/lib/simplepie/library/SimplePie/Cache/MySQL.php
@@ -278,7 +278,7 @@ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB
$query->bindValue(':data', serialize($data));
$query->bindValue(':time', time());
$query->bindValue(':feed', $this->id);
- if ($this->execute())
+ if ($query->execute())
{
return true;
}
@@ -438,3 +438,5 @@ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB
return $query->execute() && $query2->execute();
}
}
+
+class_alias('SimplePie_Cache_MySQL', 'SimplePie\Cache\MySQL', false);
diff --git a/lib/simplepie/library/SimplePie/Cache/Redis.php b/lib/simplepie/library/SimplePie/Cache/Redis.php
index dbc88e829..82d759b01 100644
--- a/lib/simplepie/library/SimplePie/Cache/Redis.php
+++ b/lib/simplepie/library/SimplePie/Cache/Redis.php
@@ -152,7 +152,7 @@ class SimplePie_Cache_Redis implements SimplePie_Cache_Base {
if ($data !== false) {
$return = $this->cache->set($this->name, $data);
if ($this->options['expire']) {
- return $this->cache->expire($this->name, $this->ttl);
+ return $this->cache->expire($this->name, $this->options['expire']);
}
return $return;
}
@@ -170,3 +170,5 @@ class SimplePie_Cache_Redis implements SimplePie_Cache_Base {
}
}
+
+class_alias('SimplePie_Cache_Redis', 'SimplePie\Cache\Redis', false);
diff --git a/lib/simplepie/library/SimplePie/Caption.php b/lib/simplepie/library/SimplePie/Caption.php
index 3d7bfdd71..355ab52f3 100644
--- a/lib/simplepie/library/SimplePie/Caption.php
+++ b/lib/simplepie/library/SimplePie/Caption.php
@@ -196,3 +196,5 @@ class SimplePie_Caption
return null;
}
}
+
+class_alias('SimplePie_Caption', 'SimplePie\Caption', false);
diff --git a/lib/simplepie/library/SimplePie/Category.php b/lib/simplepie/library/SimplePie/Category.php
index e4dabed8b..02cb76482 100644
--- a/lib/simplepie/library/SimplePie/Category.php
+++ b/lib/simplepie/library/SimplePie/Category.php
@@ -79,7 +79,7 @@ class SimplePie_Category
/**
* Category type
- *
+ *
* category for <category>
* subject for <dc:subject>
*
@@ -161,3 +161,4 @@ class SimplePie_Category
}
}
+class_alias('SimplePie_Category', 'SimplePie\Category', false);
diff --git a/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php b/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php
index 027e131ef..b3a8cf378 100644
--- a/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php
+++ b/lib/simplepie/library/SimplePie/Content/Type/Sniffer.php
@@ -316,3 +316,5 @@ class SimplePie_Content_Type_Sniffer
return 'text/html';
}
}
+
+class_alias('SimplePie_Content_Type_Sniffer', 'SimplePie\Content\Type\Sniffer', false);
diff --git a/lib/simplepie/library/SimplePie/Copyright.php b/lib/simplepie/library/SimplePie/Copyright.php
index 92f9b0947..e043ced8b 100644
--- a/lib/simplepie/library/SimplePie/Copyright.php
+++ b/lib/simplepie/library/SimplePie/Copyright.php
@@ -122,3 +122,5 @@ class SimplePie_Copyright
return null;
}
}
+
+class_alias('SimplePie_Copyright', 'SimplePie\Copyright', false);
diff --git a/lib/simplepie/library/SimplePie/Credit.php b/lib/simplepie/library/SimplePie/Credit.php
index d6ff07eba..347902e02 100644
--- a/lib/simplepie/library/SimplePie/Credit.php
+++ b/lib/simplepie/library/SimplePie/Credit.php
@@ -146,3 +146,5 @@ class SimplePie_Credit
return null;
}
}
+
+class_alias('SimplePie_Credit', 'SimplePie\Credit', false);
diff --git a/lib/simplepie/library/SimplePie/Enclosure.php b/lib/simplepie/library/SimplePie/Enclosure.php
index 32216d848..71cdd7d45 100644
--- a/lib/simplepie/library/SimplePie/Enclosure.php
+++ b/lib/simplepie/library/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-types
case 'aac':
@@ -1302,3 +1307,5 @@ class SimplePie_Enclosure
return $type;
}
}
+
+class_alias('SimplePie_Enclosure', 'SimplePie\Enclosure', false);
diff --git a/lib/simplepie/library/SimplePie/Exception.php b/lib/simplepie/library/SimplePie/Exception.php
index 7a04c560c..715cefc72 100644
--- a/lib/simplepie/library/SimplePie/Exception.php
+++ b/lib/simplepie/library/SimplePie/Exception.php
@@ -48,4 +48,6 @@
*/
class SimplePie_Exception extends Exception
{
-} \ No newline at end of file
+}
+
+class_alias('SimplePie_Exception', 'SimplePie\Exception', false);
diff --git a/lib/simplepie/library/SimplePie/File.php b/lib/simplepie/library/SimplePie/File.php
index c326ba26a..7f894fb59 100644
--- a/lib/simplepie/library/SimplePie/File.php
+++ b/lib/simplepie/library/SimplePie/File.php
@@ -106,7 +106,7 @@ class SimplePie_File
curl_setopt($fp, CURLOPT_FAILONERROR, 1);
curl_setopt($fp, CURLOPT_TIMEOUT, $timeout);
curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout);
- curl_setopt($fp, CURLOPT_REFERER, $url);
+ curl_setopt($fp, CURLOPT_REFERER, SimplePie_Misc::url_remove_credentials($url));
curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
foreach ($curl_options as $curl_param => $curl_value) {
@@ -299,3 +299,5 @@ class SimplePie_File
}
}
}
+
+class_alias('SimplePie_File', 'SimplePie\File', false);
diff --git a/lib/simplepie/library/SimplePie/HTTP/Parser.php b/lib/simplepie/library/SimplePie/HTTP/Parser.php
index 1dbe06c3e..b0f0f4a8b 100644
--- a/lib/simplepie/library/SimplePie/HTTP/Parser.php
+++ b/lib/simplepie/library/SimplePie/HTTP/Parser.php
@@ -507,12 +507,16 @@ 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;
}
}
+
+class_alias('SimplePie_HTTP_Parser', 'SimplePie\HTTP\Parser', false);
diff --git a/lib/simplepie/library/SimplePie/IRI.php b/lib/simplepie/library/SimplePie/IRI.php
index a02de682c..6cd27ddba 100644
--- a/lib/simplepie/library/SimplePie/IRI.php
+++ b/lib/simplepie/library/SimplePie/IRI.php
@@ -1234,3 +1234,5 @@ class SimplePie_IRI
return $iauthority;
}
}
+
+class_alias('SimplePie_IRI', 'SimplePie\IRI', false);
diff --git a/lib/simplepie/library/SimplePie/Item.php b/lib/simplepie/library/SimplePie/Item.php
index 3ac4fa882..02f158bfc 100644
--- a/lib/simplepie/library/SimplePie/Item.php
+++ b/lib/simplepie/library/SimplePie/Item.php
@@ -2965,3 +2965,5 @@ class SimplePie_Item
return null;
}
}
+
+class_alias('SimplePie_Item', 'SimplePie\Item', false);
diff --git a/lib/simplepie/library/SimplePie/Locator.php b/lib/simplepie/library/SimplePie/Locator.php
index ebc7ec9c1..12961dd3d 100644
--- a/lib/simplepie/library/SimplePie/Locator.php
+++ b/lib/simplepie/library/SimplePie/Locator.php
@@ -64,6 +64,7 @@ class SimplePie_Locator
var $max_checked_feeds = 10;
var $force_fsockopen = false;
var $curl_options = array();
+ var $dom;
protected $registry;
public function __construct(SimplePie_File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = array())
@@ -429,3 +430,5 @@ class SimplePie_Locator
return null;
}
}
+
+class_alias('SimplePie_Locator', 'SimplePie\Locator', false);
diff --git a/lib/simplepie/library/SimplePie/Misc.php b/lib/simplepie/library/SimplePie/Misc.php
index a52498ac7..4318573ba 100644
--- a/lib/simplepie/library/SimplePie/Misc.php
+++ b/lib/simplepie/library/SimplePie/Misc.php
@@ -2260,4 +2260,16 @@ function embed_wmedia(width, height, link) {
{
// No-op
}
+
+ /**
+ * Sanitize a URL by removing HTTP credentials.
+ * @param string $url the URL to sanitize.
+ * @return string the same URL without HTTP credentials.
+ */
+ public static function url_remove_credentials($url)
+ {
+ return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url);
+ }
}
+
+class_alias('SimplePie_Misc', 'SimplePie\Misc', false);
diff --git a/lib/simplepie/library/SimplePie/Net/IPv6.php b/lib/simplepie/library/SimplePie/Net/IPv6.php
index 25c992bd1..c7e466a54 100644
--- a/lib/simplepie/library/SimplePie/Net/IPv6.php
+++ b/lib/simplepie/library/SimplePie/Net/IPv6.php
@@ -267,3 +267,5 @@ class SimplePie_Net_IPv6
return self::check_ipv6($ip);
}
}
+
+class_alias('SimplePie_Net_IPv6', 'SimplePie\Net\IPv6', false);
diff --git a/lib/simplepie/library/SimplePie/Parse/Date.php b/lib/simplepie/library/SimplePie/Parse/Date.php
index cf57437d2..fe7e3ea49 100644
--- a/lib/simplepie/library/SimplePie/Parse/Date.php
+++ b/lib/simplepie/library/SimplePie/Parse/Date.php
@@ -1023,3 +1023,5 @@ class SimplePie_Parse_Date
return $strtotime;
}
}
+
+class_alias('SimplePie_Parse_Date', 'SimplePie\Parse\Date', false);
diff --git a/lib/simplepie/library/SimplePie/Parser.php b/lib/simplepie/library/SimplePie/Parser.php
index 3813b74b2..65f32d72a 100644
--- a/lib/simplepie/library/SimplePie/Parser.php
+++ b/lib/simplepie/library/SimplePie/Parser.php
@@ -677,3 +677,5 @@ class SimplePie_Parser
return '<!DOCTYPE html [ <!ENTITY nbsp "&#x00A0;"> <!ENTITY iexcl "&#x00A1;"> <!ENTITY cent "&#x00A2;"> <!ENTITY pound "&#x00A3;"> <!ENTITY curren "&#x00A4;"> <!ENTITY yen "&#x00A5;"> <!ENTITY brvbar "&#x00A6;"> <!ENTITY sect "&#x00A7;"> <!ENTITY uml "&#x00A8;"> <!ENTITY copy "&#x00A9;"> <!ENTITY ordf "&#x00AA;"> <!ENTITY laquo "&#x00AB;"> <!ENTITY not "&#x00AC;"> <!ENTITY shy "&#x00AD;"> <!ENTITY reg "&#x00AE;"> <!ENTITY macr "&#x00AF;"> <!ENTITY deg "&#x00B0;"> <!ENTITY plusmn "&#x00B1;"> <!ENTITY sup2 "&#x00B2;"> <!ENTITY sup3 "&#x00B3;"> <!ENTITY acute "&#x00B4;"> <!ENTITY micro "&#x00B5;"> <!ENTITY para "&#x00B6;"> <!ENTITY middot "&#x00B7;"> <!ENTITY cedil "&#x00B8;"> <!ENTITY sup1 "&#x00B9;"> <!ENTITY ordm "&#x00BA;"> <!ENTITY raquo "&#x00BB;"> <!ENTITY frac14 "&#x00BC;"> <!ENTITY frac12 "&#x00BD;"> <!ENTITY frac34 "&#x00BE;"> <!ENTITY iquest "&#x00BF;"> <!ENTITY Agrave "&#x00C0;"> <!ENTITY Aacute "&#x00C1;"> <!ENTITY Acirc "&#x00C2;"> <!ENTITY Atilde "&#x00C3;"> <!ENTITY Auml "&#x00C4;"> <!ENTITY Aring "&#x00C5;"> <!ENTITY AElig "&#x00C6;"> <!ENTITY Ccedil "&#x00C7;"> <!ENTITY Egrave "&#x00C8;"> <!ENTITY Eacute "&#x00C9;"> <!ENTITY Ecirc "&#x00CA;"> <!ENTITY Euml "&#x00CB;"> <!ENTITY Igrave "&#x00CC;"> <!ENTITY Iacute "&#x00CD;"> <!ENTITY Icirc "&#x00CE;"> <!ENTITY Iuml "&#x00CF;"> <!ENTITY ETH "&#x00D0;"> <!ENTITY Ntilde "&#x00D1;"> <!ENTITY Ograve "&#x00D2;"> <!ENTITY Oacute "&#x00D3;"> <!ENTITY Ocirc "&#x00D4;"> <!ENTITY Otilde "&#x00D5;"> <!ENTITY Ouml "&#x00D6;"> <!ENTITY times "&#x00D7;"> <!ENTITY Oslash "&#x00D8;"> <!ENTITY Ugrave "&#x00D9;"> <!ENTITY Uacute "&#x00DA;"> <!ENTITY Ucirc "&#x00DB;"> <!ENTITY Uuml "&#x00DC;"> <!ENTITY Yacute "&#x00DD;"> <!ENTITY THORN "&#x00DE;"> <!ENTITY szlig "&#x00DF;"> <!ENTITY agrave "&#x00E0;"> <!ENTITY aacute "&#x00E1;"> <!ENTITY acirc "&#x00E2;"> <!ENTITY atilde "&#x00E3;"> <!ENTITY auml "&#x00E4;"> <!ENTITY aring "&#x00E5;"> <!ENTITY aelig "&#x00E6;"> <!ENTITY ccedil "&#x00E7;"> <!ENTITY egrave "&#x00E8;"> <!ENTITY eacute "&#x00E9;"> <!ENTITY ecirc "&#x00EA;"> <!ENTITY euml "&#x00EB;"> <!ENTITY igrave "&#x00EC;"> <!ENTITY iacute "&#x00ED;"> <!ENTITY icirc "&#x00EE;"> <!ENTITY iuml "&#x00EF;"> <!ENTITY eth "&#x00F0;"> <!ENTITY ntilde "&#x00F1;"> <!ENTITY ograve "&#x00F2;"> <!ENTITY oacute "&#x00F3;"> <!ENTITY ocirc "&#x00F4;"> <!ENTITY otilde "&#x00F5;"> <!ENTITY ouml "&#x00F6;"> <!ENTITY divide "&#x00F7;"> <!ENTITY oslash "&#x00F8;"> <!ENTITY ugrave "&#x00F9;"> <!ENTITY uacute "&#x00FA;"> <!ENTITY ucirc "&#x00FB;"> <!ENTITY uuml "&#x00FC;"> <!ENTITY yacute "&#x00FD;"> <!ENTITY thorn "&#x00FE;"> <!ENTITY yuml "&#x00FF;"> <!ENTITY OElig "&#x0152;"> <!ENTITY oelig "&#x0153;"> <!ENTITY Scaron "&#x0160;"> <!ENTITY scaron "&#x0161;"> <!ENTITY Yuml "&#x0178;"> <!ENTITY fnof "&#x0192;"> <!ENTITY circ "&#x02C6;"> <!ENTITY tilde "&#x02DC;"> <!ENTITY Alpha "&#x0391;"> <!ENTITY Beta "&#x0392;"> <!ENTITY Gamma "&#x0393;"> <!ENTITY Epsilon "&#x0395;"> <!ENTITY Zeta "&#x0396;"> <!ENTITY Eta "&#x0397;"> <!ENTITY Theta "&#x0398;"> <!ENTITY Iota "&#x0399;"> <!ENTITY Kappa "&#x039A;"> <!ENTITY Lambda "&#x039B;"> <!ENTITY Mu "&#x039C;"> <!ENTITY Nu "&#x039D;"> <!ENTITY Xi "&#x039E;"> <!ENTITY Omicron "&#x039F;"> <!ENTITY Pi "&#x03A0;"> <!ENTITY Rho "&#x03A1;"> <!ENTITY Sigma "&#x03A3;"> <!ENTITY Tau "&#x03A4;"> <!ENTITY Upsilon "&#x03A5;"> <!ENTITY Phi "&#x03A6;"> <!ENTITY Chi "&#x03A7;"> <!ENTITY Psi "&#x03A8;"> <!ENTITY Omega "&#x03A9;"> <!ENTITY alpha "&#x03B1;"> <!ENTITY beta "&#x03B2;"> <!ENTITY gamma "&#x03B3;"> <!ENTITY delta "&#x03B4;"> <!ENTITY epsilon "&#x03B5;"> <!ENTITY zeta "&#x03B6;"> <!ENTITY eta "&#x03B7;"> <!ENTITY theta "&#x03B8;"> <!ENTITY iota "&#x03B9;"> <!ENTITY kappa "&#x03BA;"> <!ENTITY lambda "&#x03BB;"> <!ENTITY mu "&#x03BC;"> <!ENTITY nu "&#x03BD;"> <!ENTITY xi "&#x03BE;"> <!ENTITY omicron "&#x03BF;"> <!ENTITY pi "&#x03C0;"> <!ENTITY rho "&#x03C1;"> <!ENTITY sigmaf "&#x03C2;"> <!ENTITY sigma "&#x03C3;"> <!ENTITY tau "&#x03C4;"> <!ENTITY upsilon "&#x03C5;"> <!ENTITY phi "&#x03C6;"> <!ENTITY chi "&#x03C7;"> <!ENTITY psi "&#x03C8;"> <!ENTITY omega "&#x03C9;"> <!ENTITY thetasym "&#x03D1;"> <!ENTITY upsih "&#x03D2;"> <!ENTITY piv "&#x03D6;"> <!ENTITY ensp "&#x2002;"> <!ENTITY emsp "&#x2003;"> <!ENTITY thinsp "&#x2009;"> <!ENTITY zwnj "&#x200C;"> <!ENTITY zwj "&#x200D;"> <!ENTITY lrm "&#x200E;"> <!ENTITY rlm "&#x200F;"> <!ENTITY ndash "&#x2013;"> <!ENTITY mdash "&#x2014;"> <!ENTITY lsquo "&#x2018;"> <!ENTITY rsquo "&#x2019;"> <!ENTITY sbquo "&#x201A;"> <!ENTITY ldquo "&#x201C;"> <!ENTITY rdquo "&#x201D;"> <!ENTITY bdquo "&#x201E;"> <!ENTITY dagger "&#x2020;"> <!ENTITY Dagger "&#x2021;"> <!ENTITY bull "&#x2022;"> <!ENTITY hellip "&#x2026;"> <!ENTITY permil "&#x2030;"> <!ENTITY prime "&#x2032;"> <!ENTITY Prime "&#x2033;"> <!ENTITY lsaquo "&#x2039;"> <!ENTITY rsaquo "&#x203A;"> <!ENTITY oline "&#x203E;"> <!ENTITY frasl "&#x2044;"> <!ENTITY euro "&#x20AC;"> <!ENTITY image "&#x2111;"> <!ENTITY weierp "&#x2118;"> <!ENTITY real "&#x211C;"> <!ENTITY trade "&#x2122;"> <!ENTITY alefsym "&#x2135;"> <!ENTITY larr "&#x2190;"> <!ENTITY uarr "&#x2191;"> <!ENTITY rarr "&#x2192;"> <!ENTITY darr "&#x2193;"> <!ENTITY harr "&#x2194;"> <!ENTITY crarr "&#x21B5;"> <!ENTITY lArr "&#x21D0;"> <!ENTITY uArr "&#x21D1;"> <!ENTITY rArr "&#x21D2;"> <!ENTITY dArr "&#x21D3;"> <!ENTITY hArr "&#x21D4;"> <!ENTITY forall "&#x2200;"> <!ENTITY part "&#x2202;"> <!ENTITY exist "&#x2203;"> <!ENTITY empty "&#x2205;"> <!ENTITY nabla "&#x2207;"> <!ENTITY isin "&#x2208;"> <!ENTITY notin "&#x2209;"> <!ENTITY ni "&#x220B;"> <!ENTITY prod "&#x220F;"> <!ENTITY sum "&#x2211;"> <!ENTITY minus "&#x2212;"> <!ENTITY lowast "&#x2217;"> <!ENTITY radic "&#x221A;"> <!ENTITY prop "&#x221D;"> <!ENTITY infin "&#x221E;"> <!ENTITY ang "&#x2220;"> <!ENTITY and "&#x2227;"> <!ENTITY or "&#x2228;"> <!ENTITY cap "&#x2229;"> <!ENTITY cup "&#x222A;"> <!ENTITY int "&#x222B;"> <!ENTITY there4 "&#x2234;"> <!ENTITY sim "&#x223C;"> <!ENTITY cong "&#x2245;"> <!ENTITY asymp "&#x2248;"> <!ENTITY ne "&#x2260;"> <!ENTITY equiv "&#x2261;"> <!ENTITY le "&#x2264;"> <!ENTITY ge "&#x2265;"> <!ENTITY sub "&#x2282;"> <!ENTITY sup "&#x2283;"> <!ENTITY nsub "&#x2284;"> <!ENTITY sube "&#x2286;"> <!ENTITY supe "&#x2287;"> <!ENTITY oplus "&#x2295;"> <!ENTITY otimes "&#x2297;"> <!ENTITY perp "&#x22A5;"> <!ENTITY sdot "&#x22C5;"> <!ENTITY lceil "&#x2308;"> <!ENTITY rceil "&#x2309;"> <!ENTITY lfloor "&#x230A;"> <!ENTITY rfloor "&#x230B;"> <!ENTITY lang "&#x2329;"> <!ENTITY rang "&#x232A;"> <!ENTITY loz "&#x25CA;"> <!ENTITY spades "&#x2660;"> <!ENTITY clubs "&#x2663;"> <!ENTITY hearts "&#x2665;"> <!ENTITY diams "&#x2666;"> ]>';
}
}
+
+class_alias('SimplePie_Parser', 'SimplePie\Parser', false);
diff --git a/lib/simplepie/library/SimplePie/Rating.php b/lib/simplepie/library/SimplePie/Rating.php
index 599f75acb..eae6718a7 100644
--- a/lib/simplepie/library/SimplePie/Rating.php
+++ b/lib/simplepie/library/SimplePie/Rating.php
@@ -122,3 +122,5 @@ class SimplePie_Rating
return null;
}
}
+
+class_alias('SimplePie_Rating', 'SimplePie\Rating', false);
diff --git a/lib/simplepie/library/SimplePie/Registry.php b/lib/simplepie/library/SimplePie/Registry.php
index bf3baf179..2486f3c69 100755
--- a/lib/simplepie/library/SimplePie/Registry.php
+++ b/lib/simplepie/library/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);
@@ -222,3 +223,5 @@ class SimplePie_Registry
return $result;
}
}
+
+class_alias('SimplePie_Registry', 'SimplePie\Registry', false);
diff --git a/lib/simplepie/library/SimplePie/Restriction.php b/lib/simplepie/library/SimplePie/Restriction.php
index 950017fae..0a168bbbe 100644
--- a/lib/simplepie/library/SimplePie/Restriction.php
+++ b/lib/simplepie/library/SimplePie/Restriction.php
@@ -146,3 +146,5 @@ class SimplePie_Restriction
return null;
}
}
+
+class_alias('SimplePie_Restriction', 'SimplePie\Restriction', false);
diff --git a/lib/simplepie/library/SimplePie/Sanitize.php b/lib/simplepie/library/SimplePie/Sanitize.php
index 84d35ad25..1f202ecc0 100644
--- a/lib/simplepie/library/SimplePie/Sanitize.php
+++ b/lib/simplepie/library/SimplePie/Sanitize.php
@@ -61,6 +61,7 @@ class SimplePie_Sanitize
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
var $encode_instead_of_strip = false;
var $strip_attributes = array('bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');
+ var $rename_attributes = array();
var $add_attributes = array('audio' => array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none'));
var $strip_comments = false;
var $output_encoding = 'UTF-8';
@@ -71,12 +72,13 @@ class SimplePie_Sanitize
var $useragent = '';
var $force_fsockopen = false;
var $replace_url_attributes = null;
+ var $registry;
/**
* List of domains for which to force HTTPS.
* @see SimplePie_Sanitize::set_https_domains()
* Array is a tree split at DNS levels. Example:
- * array('biz' => true, 'com' => array('example' => true), 'net' => array('example') => array('www' => true))
+ * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true)))
*/
var $https_domains = array();
@@ -168,6 +170,25 @@ class SimplePie_Sanitize
$this->encode_instead_of_strip = (bool) $encode;
}
+ public function rename_attributes($attribs = array())
+ {
+ if ($attribs)
+ {
+ if (is_array($attribs))
+ {
+ $this->rename_attributes = $attribs;
+ }
+ else
+ {
+ $this->rename_attributes = explode(',', $attribs);
+ }
+ }
+ else
+ {
+ $this->rename_attributes = false;
+ }
+ }
+
public function strip_attributes($attribs = array('bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'))
{
if ($attribs)
@@ -220,9 +241,9 @@ class SimplePie_Sanitize
* Set element/attribute key/value pairs of HTML attributes
* containing URLs that need to be resolved relative to the feed
*
- * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite,
- * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite,
- * |q|@cite
+ * Defaults to |a|@href, |area|@href, |audio|@src, |blockquote|@cite,
+ * |del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src,
+ * |ins|@cite, |q|@cite, |source|@src, |video|@src
*
* @since 1.0
* @param array|null $element_attribute Element/attribute key/value pairs, null for default
@@ -234,6 +255,7 @@ class SimplePie_Sanitize
$element_attribute = array(
'a' => 'href',
'area' => 'href',
+ 'audio' => 'src',
'blockquote' => 'cite',
'del' => 'cite',
'form' => 'action',
@@ -243,7 +265,12 @@ class SimplePie_Sanitize
),
'input' => 'src',
'ins' => 'cite',
- 'q' => 'cite'
+ 'q' => 'cite',
+ 'source' => 'src',
+ 'video' => array(
+ 'poster',
+ 'src'
+ )
);
}
$this->replace_url_attributes = (array) $element_attribute;
@@ -373,6 +400,14 @@ class SimplePie_Sanitize
}
}
+ if ($this->rename_attributes)
+ {
+ foreach ($this->rename_attributes as $attrib)
+ {
+ $this->rename_attr($attrib, $xpath);
+ }
+ }
+
if ($this->strip_attributes)
{
foreach ($this->strip_attributes as $attrib)
@@ -446,6 +481,8 @@ class SimplePie_Sanitize
{
$data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data);
}
+
+ $data = str_replace('</source>', '', $data);
}
if ($type & SIMPLEPIE_CONSTRUCT_IRI)
@@ -641,6 +678,17 @@ class SimplePie_Sanitize
}
}
+ protected function rename_attr($attrib, $xpath)
+ {
+ $elements = $xpath->query('//*[@' . $attrib . ']');
+
+ foreach ($elements as $element)
+ {
+ $element->setAttribute('data-sanitized-' . $attrib, $element->getAttribute($attrib));
+ $element->removeAttribute($attrib);
+ }
+ }
+
protected function add_attr($tag, $valuePairs, $document)
{
$elements = $document->getElementsByTagName($tag);
@@ -653,3 +701,5 @@ class SimplePie_Sanitize
}
}
}
+
+class_alias('SimplePie_Sanitize', 'SimplePie\Sanitize', false);
diff --git a/lib/simplepie/library/SimplePie/Source.php b/lib/simplepie/library/SimplePie/Source.php
index f14e5b220..9e7ddf04d 100644
--- a/lib/simplepie/library/SimplePie/Source.php
+++ b/lib/simplepie/library/SimplePie/Source.php
@@ -575,3 +575,5 @@ class SimplePie_Source
return null;
}
}
+
+class_alias('SimplePie_Source', 'SimplePie\Source', false);
diff --git a/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php b/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php
index 0c857a586..9ac088704 100644
--- a/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php
+++ b/lib/simplepie/library/SimplePie/XML/Declaration/Parser.php
@@ -357,3 +357,5 @@ class SimplePie_XML_Declaration_Parser
}
}
}
+
+class_alias('SimplePie_XML_Declaration_Parser', 'SimplePie\XML\Declaration\Parser', false);
diff --git a/lib/simplepie/library/SimplePie/gzdecode.php b/lib/simplepie/library/SimplePie/gzdecode.php
index 9c54f8833..030a230d0 100644
--- a/lib/simplepie/library/SimplePie/gzdecode.php
+++ b/lib/simplepie/library/SimplePie/gzdecode.php
@@ -364,3 +364,5 @@ class SimplePie_gzdecode
return false;
}
}
+
+class_alias('SimplePie_gzdecode', 'SimplePie\Gzdecode', false);