From 1aec297145a150f627e6ed82b8b084e0c933def8 Mon Sep 17 00:00:00 2001 From: Juliette <663378+jrfnl@users.noreply.github.com> Date: Tue, 28 Dec 2021 08:41:14 +0100 Subject: [PATCH 01/44] GH Actions: version update for `ramsey/composer-install` (#713) The action used to install Composer packages and handle the caching has released a new major (and some follow-up patch releases), which means, the action reference needs to be updated to benefit from it. Refs: * https://github.com/ramsey/composer-install/releases/tag/2.0.0 * https://github.com/ramsey/composer-install/releases/tag/2.0.1 * https://github.com/ramsey/composer-install/releases/tag/2.0.2 Co-authored-by: jrfnl --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6ce02eff..d38ad0110 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,11 +34,11 @@ jobs: # @link https://github.com/marketplace/actions/install-composer-dependencies - name: "Install Composer dependencies (PHP < 8.1)" if: ${{ matrix.php < '8.1' }} - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" - name: "Install Composer dependencies (PHP 8.1)" if: ${{ matrix.php >= '8.1' }} - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: composer-options: --ignore-platform-reqs From baf82e891e0e91ef5fdab938ec37b6adeb3d4b2a Mon Sep 17 00:00:00 2001 From: maTh Date: Sat, 5 Feb 2022 07:25:47 +0100 Subject: [PATCH 02/44] added: Sanitize::rename_attributes() (#717) * added rename_attributes() * fixed the comment * Update SimplePie.php * correct variables name * reordering --- library/SimplePie.php | 16 ++++++++++++++ library/SimplePie/Sanitize.php | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/library/SimplePie.php b/library/SimplePie.php index 29c8ece01..f11acf1e4 100755 --- a/library/SimplePie.php +++ b/library/SimplePie.php @@ -650,6 +650,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 @@ public function encode_instead_of_strip($enable = true) $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 === '') diff --git a/library/SimplePie/Sanitize.php b/library/SimplePie/Sanitize.php index d421c8307..0ed3a5bda 100644 --- a/library/SimplePie/Sanitize.php +++ b/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'; @@ -169,6 +170,25 @@ public function encode_instead_of_strip($encode = false) $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) @@ -374,6 +394,14 @@ public function sanitize($data, $type, $base = '') } } + 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) @@ -642,6 +670,17 @@ protected function strip_attr($attrib, $xpath) } } + 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); From a0ed2ab1d35950296e2593b2d77760db6fdd884c Mon Sep 17 00:00:00 2001 From: Artur Weigandt Date: Tue, 22 Feb 2022 06:55:40 +0100 Subject: [PATCH 03/44] Bugfix in MySQL cache (#720) --- library/SimplePie/Cache/MySQL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/SimplePie/Cache/MySQL.php b/library/SimplePie/Cache/MySQL.php index a684eb833..65d50d86c 100644 --- a/library/SimplePie/Cache/MySQL.php +++ b/library/SimplePie/Cache/MySQL.php @@ -278,7 +278,7 @@ public function save($data) $query->bindValue(':data', serialize($data)); $query->bindValue(':time', time()); $query->bindValue(':feed', $this->id); - if ($this->execute()) + if ($query->execute()) { return true; } From 3e2fa52db60a050c87657e4b6f31f5f65aee7fb8 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 28 Feb 2022 01:06:37 +0100 Subject: [PATCH 04/44] Re-enable xml:base for all supported RSS formats (#723) Reverts https://github.com/simplepie/simplepie/commit/e49c578817aa504d8d05cd7f33857aeda9d41908 Specification, e.g. Atom: * https://datatracker.ietf.org/doc/html/rfc4287#section-2 > Any element defined by this specification MAY have an xml:base attribute While RSS 2.0 is silent on the matter https://cyber.harvard.edu/rss/relativeURI.html , here are examples of use from the same epoch: * https://rssweblog.com/?guid=20050627094747 * https://www.drupal.org/project/views/issues/943762 --- library/SimplePie.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/SimplePie.php b/library/SimplePie.php index f11acf1e4..880e38674 100755 --- a/library/SimplePie.php +++ b/library/SimplePie.php @@ -2215,7 +2215,7 @@ public function get_image_tags($namespace, $tag) */ 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']; } From 2f820e16b45629e9e9026589ca4f6536ceedb1ac Mon Sep 17 00:00:00 2001 From: Artur Weigandt Date: Mon, 28 Feb 2022 01:14:25 +0100 Subject: [PATCH 05/44] Add namespaced classes and PSR-4 support (#711) * Add namespaced classes, PSR-4 support and tests * fix code style --- composer.json | 8 +++ library/SimplePie.php | 2 + library/SimplePie/Author.php | 2 + library/SimplePie/Cache.php | 2 + library/SimplePie/Cache/Base.php | 2 + library/SimplePie/Cache/DB.php | 2 + library/SimplePie/Cache/File.php | 2 + library/SimplePie/Cache/Memcache.php | 2 + library/SimplePie/Cache/Memcached.php | 2 + library/SimplePie/Cache/MySQL.php | 2 + library/SimplePie/Cache/Redis.php | 2 + library/SimplePie/Caption.php | 2 + library/SimplePie/Category.php | 3 +- library/SimplePie/Content/Type/Sniffer.php | 2 + library/SimplePie/Copyright.php | 2 + library/SimplePie/Credit.php | 2 + library/SimplePie/Enclosure.php | 2 + library/SimplePie/Exception.php | 4 +- library/SimplePie/File.php | 2 + library/SimplePie/HTTP/Parser.php | 2 + library/SimplePie/IRI.php | 2 + library/SimplePie/Item.php | 2 + library/SimplePie/Locator.php | 2 + library/SimplePie/Misc.php | 2 + library/SimplePie/Net/IPv6.php | 2 + library/SimplePie/Parse/Date.php | 2 + library/SimplePie/Parser.php | 2 + library/SimplePie/Rating.php | 2 + library/SimplePie/Registry.php | 2 + library/SimplePie/Restriction.php | 2 + library/SimplePie/Sanitize.php | 2 + library/SimplePie/Source.php | 2 + library/SimplePie/XML/Declaration/Parser.php | 2 + library/SimplePie/gzdecode.php | 2 + src/Author.php | 55 +++++++++++++++++ src/Cache.php | 55 +++++++++++++++++ src/Cache/Base.php | 55 +++++++++++++++++ src/Cache/DB.php | 55 +++++++++++++++++ src/Cache/File.php | 55 +++++++++++++++++ src/Cache/Memcache.php | 55 +++++++++++++++++ src/Cache/Memcached.php | 55 +++++++++++++++++ src/Cache/MySQL.php | 55 +++++++++++++++++ src/Cache/Redis.php | 55 +++++++++++++++++ src/Caption.php | 55 +++++++++++++++++ src/Category.php | 55 +++++++++++++++++ src/Content/Type/Sniffer.php | 55 +++++++++++++++++ src/Copyright.php | 55 +++++++++++++++++ src/Credit.php | 55 +++++++++++++++++ src/Enclosure.php | 55 +++++++++++++++++ src/Exception.php | 55 +++++++++++++++++ src/File.php | 55 +++++++++++++++++ src/Gzdecode.php | 55 +++++++++++++++++ src/HTTP/Parser.php | 55 +++++++++++++++++ src/IRI.php | 55 +++++++++++++++++ src/Item.php | 55 +++++++++++++++++ src/Locator.php | 55 +++++++++++++++++ src/Misc.php | 55 +++++++++++++++++ src/Net/IPv6.php | 55 +++++++++++++++++ src/Parse/Date.php | 55 +++++++++++++++++ src/Parser.php | 55 +++++++++++++++++ src/Rating.php | 55 +++++++++++++++++ src/Registry.php | 55 +++++++++++++++++ src/Restriction.php | 55 +++++++++++++++++ src/Sanitize.php | 55 +++++++++++++++++ src/SimplePie.php | 55 +++++++++++++++++ src/Source.php | 55 +++++++++++++++++ src/XML/Declaration/Parser.php | 55 +++++++++++++++++ tests/Unit/AuthorTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/BaseTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/DBTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/FileTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/MemcacheTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/MemcachedTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/MySQLTest.php | 62 ++++++++++++++++++++ tests/Unit/Cache/RedisTest.php | 62 ++++++++++++++++++++ tests/Unit/CacheTest.php | 62 ++++++++++++++++++++ tests/Unit/CaptionTest.php | 62 ++++++++++++++++++++ tests/Unit/CategoryTest.php | 62 ++++++++++++++++++++ tests/Unit/Content/Type/SnifferTest.php | 62 ++++++++++++++++++++ tests/Unit/CopyrightTest.php | 62 ++++++++++++++++++++ tests/Unit/CreditTest.php | 62 ++++++++++++++++++++ tests/Unit/EnclosureTest.php | 62 ++++++++++++++++++++ tests/Unit/ExceptionTest.php | 62 ++++++++++++++++++++ tests/Unit/FileTest.php | 62 ++++++++++++++++++++ tests/Unit/GzdecodeTest.php | 62 ++++++++++++++++++++ tests/Unit/HTTP/ParserTest.php | 62 ++++++++++++++++++++ tests/Unit/IRITest.php | 62 ++++++++++++++++++++ tests/Unit/ItemTest.php | 62 ++++++++++++++++++++ tests/Unit/LocatorTest.php | 62 ++++++++++++++++++++ tests/Unit/MiscTest.php | 62 ++++++++++++++++++++ tests/Unit/Net/IPv6Test.php | 62 ++++++++++++++++++++ tests/Unit/Parse/DateTest.php | 62 ++++++++++++++++++++ tests/Unit/ParserTest.php | 62 ++++++++++++++++++++ tests/Unit/RatingTest.php | 62 ++++++++++++++++++++ tests/Unit/RegistryTest.php | 62 ++++++++++++++++++++ tests/Unit/RestrictionTest.php | 62 ++++++++++++++++++++ tests/Unit/SanitizeTest.php | 62 ++++++++++++++++++++ tests/Unit/SimplePieTest.php | 62 ++++++++++++++++++++ tests/Unit/SourceTest.php | 62 ++++++++++++++++++++ tests/Unit/XML/Declaration/ParserTest.php | 62 ++++++++++++++++++++ 100 files changed, 3936 insertions(+), 2 deletions(-) create mode 100644 src/Author.php create mode 100644 src/Cache.php create mode 100644 src/Cache/Base.php create mode 100644 src/Cache/DB.php create mode 100644 src/Cache/File.php create mode 100644 src/Cache/Memcache.php create mode 100644 src/Cache/Memcached.php create mode 100644 src/Cache/MySQL.php create mode 100644 src/Cache/Redis.php create mode 100644 src/Caption.php create mode 100644 src/Category.php create mode 100644 src/Content/Type/Sniffer.php create mode 100644 src/Copyright.php create mode 100644 src/Credit.php create mode 100644 src/Enclosure.php create mode 100644 src/Exception.php create mode 100644 src/File.php create mode 100644 src/Gzdecode.php create mode 100644 src/HTTP/Parser.php create mode 100644 src/IRI.php create mode 100644 src/Item.php create mode 100644 src/Locator.php create mode 100644 src/Misc.php create mode 100644 src/Net/IPv6.php create mode 100644 src/Parse/Date.php create mode 100644 src/Parser.php create mode 100644 src/Rating.php create mode 100644 src/Registry.php create mode 100644 src/Restriction.php create mode 100644 src/Sanitize.php create mode 100644 src/SimplePie.php create mode 100644 src/Source.php create mode 100644 src/XML/Declaration/Parser.php create mode 100644 tests/Unit/AuthorTest.php create mode 100644 tests/Unit/Cache/BaseTest.php create mode 100644 tests/Unit/Cache/DBTest.php create mode 100644 tests/Unit/Cache/FileTest.php create mode 100644 tests/Unit/Cache/MemcacheTest.php create mode 100644 tests/Unit/Cache/MemcachedTest.php create mode 100644 tests/Unit/Cache/MySQLTest.php create mode 100644 tests/Unit/Cache/RedisTest.php create mode 100644 tests/Unit/CacheTest.php create mode 100644 tests/Unit/CaptionTest.php create mode 100644 tests/Unit/CategoryTest.php create mode 100644 tests/Unit/Content/Type/SnifferTest.php create mode 100644 tests/Unit/CopyrightTest.php create mode 100644 tests/Unit/CreditTest.php create mode 100644 tests/Unit/EnclosureTest.php create mode 100644 tests/Unit/ExceptionTest.php create mode 100644 tests/Unit/FileTest.php create mode 100644 tests/Unit/GzdecodeTest.php create mode 100644 tests/Unit/HTTP/ParserTest.php create mode 100644 tests/Unit/IRITest.php create mode 100644 tests/Unit/ItemTest.php create mode 100644 tests/Unit/LocatorTest.php create mode 100644 tests/Unit/MiscTest.php create mode 100644 tests/Unit/Net/IPv6Test.php create mode 100644 tests/Unit/Parse/DateTest.php create mode 100644 tests/Unit/ParserTest.php create mode 100644 tests/Unit/RatingTest.php create mode 100644 tests/Unit/RegistryTest.php create mode 100644 tests/Unit/RestrictionTest.php create mode 100644 tests/Unit/SanitizeTest.php create mode 100644 tests/Unit/SimplePieTest.php create mode 100644 tests/Unit/SourceTest.php create mode 100644 tests/Unit/XML/Declaration/ParserTest.php diff --git a/composer.json b/composer.json index 83efa2d82..ca9ec8363 100644 --- a/composer.json +++ b/composer.json @@ -40,10 +40,18 @@ "mf2/mf2": "Microformat module that allows for parsing HTML for microformats" }, "autoload": { + "psr-4": { + "SimplePie\\": "src" + }, "psr-0": { "SimplePie": "library" } }, + "autoload-dev": { + "psr-4": { + "SimplePie\\Tests\\Unit\\": "tests/Unit" + } + }, "config": { "bin-dir": "bin" }, diff --git a/library/SimplePie.php b/library/SimplePie.php index 880e38674..7551e1d02 100755 --- a/library/SimplePie.php +++ b/library/SimplePie.php @@ -3332,3 +3332,5 @@ private function store_links(&$file, $hub, $self) { } } } + +class_alias('SimplePie', 'SimplePie\SimplePie', false); diff --git a/library/SimplePie/Author.php b/library/SimplePie/Author.php index 563932f4c..3baadee62 100644 --- a/library/SimplePie/Author.php +++ b/library/SimplePie/Author.php @@ -147,3 +147,5 @@ public function get_email() return null; } } + +class_alias('SimplePie_Author', 'SimplePie\Author', false); diff --git a/library/SimplePie/Cache.php b/library/SimplePie/Cache.php index 9c5577d95..88d811660 100644 --- a/library/SimplePie/Cache.php +++ b/library/SimplePie/Cache.php @@ -132,3 +132,5 @@ public static function parse_URL($url) return $params; } } + +class_alias('SimplePie_Cache', 'SimplePie\Cache', false); diff --git a/library/SimplePie/Cache/Base.php b/library/SimplePie/Cache/Base.php index 522ff7e10..29eb0594b 100644 --- a/library/SimplePie/Cache/Base.php +++ b/library/SimplePie/Cache/Base.php @@ -111,3 +111,5 @@ public function touch(); */ public function unlink(); } + +class_alias('SimplePie_Cache_Base', 'SimplePie\Cache\Base', false); diff --git a/library/SimplePie/Cache/DB.php b/library/SimplePie/Cache/DB.php index 74d57b8da..3dca8e5db 100644 --- a/library/SimplePie/Cache/DB.php +++ b/library/SimplePie/Cache/DB.php @@ -134,3 +134,5 @@ protected static function prepare_simplepie_object_for_cache($data) return array(serialize($data->data), $items_by_id); } } + +class_alias('SimplePie_Cache_DB', 'SimplePie\Cache\DB', false); diff --git a/library/SimplePie/Cache/File.php b/library/SimplePie/Cache/File.php index 03758e923..db30e7a0f 100644 --- a/library/SimplePie/Cache/File.php +++ b/library/SimplePie/Cache/File.php @@ -162,3 +162,5 @@ public function unlink() return false; } } + +class_alias('SimplePie_Cache_File', 'SimplePie\Cache\File', false); diff --git a/library/SimplePie/Cache/Memcache.php b/library/SimplePie/Cache/Memcache.php index caf785275..2cc37f907 100644 --- a/library/SimplePie/Cache/Memcache.php +++ b/library/SimplePie/Cache/Memcache.php @@ -178,3 +178,5 @@ public function unlink() return $this->cache->delete($this->name, 0); } } + +class_alias('SimplePie_Cache_Memcache', 'SimplePie\Cache\Memcache', false); diff --git a/library/SimplePie/Cache/Memcached.php b/library/SimplePie/Cache/Memcached.php index 0b40d87c8..32a53eb7b 100755 --- a/library/SimplePie/Cache/Memcached.php +++ b/library/SimplePie/Cache/Memcached.php @@ -164,3 +164,5 @@ private function setData($data) { return false; } } + +class_alias('SimplePie_Cache_Memcached', 'SimplePie\Cache\Memcached', false); diff --git a/library/SimplePie/Cache/MySQL.php b/library/SimplePie/Cache/MySQL.php index 65d50d86c..d21e2b6e4 100644 --- a/library/SimplePie/Cache/MySQL.php +++ b/library/SimplePie/Cache/MySQL.php @@ -438,3 +438,5 @@ public function unlink() return $query->execute() && $query2->execute(); } } + +class_alias('SimplePie_Cache_MySQL', 'SimplePie\Cache\MySQL', false); diff --git a/library/SimplePie/Cache/Redis.php b/library/SimplePie/Cache/Redis.php index a5925bec2..82d759b01 100644 --- a/library/SimplePie/Cache/Redis.php +++ b/library/SimplePie/Cache/Redis.php @@ -170,3 +170,5 @@ public function unlink() { } } + +class_alias('SimplePie_Cache_Redis', 'SimplePie\Cache\Redis', false); diff --git a/library/SimplePie/Caption.php b/library/SimplePie/Caption.php index 3d7bfdd71..355ab52f3 100644 --- a/library/SimplePie/Caption.php +++ b/library/SimplePie/Caption.php @@ -196,3 +196,5 @@ public function get_type() return null; } } + +class_alias('SimplePie_Caption', 'SimplePie\Caption', false); diff --git a/library/SimplePie/Category.php b/library/SimplePie/Category.php index e4dabed8b..02cb76482 100644 --- a/library/SimplePie/Category.php +++ b/library/SimplePie/Category.php @@ -79,7 +79,7 @@ class SimplePie_Category /** * Category type - * + * * category for * subject for * @@ -161,3 +161,4 @@ public function get_type() } } +class_alias('SimplePie_Category', 'SimplePie\Category', false); diff --git a/library/SimplePie/Content/Type/Sniffer.php b/library/SimplePie/Content/Type/Sniffer.php index 027e131ef..b3a8cf378 100644 --- a/library/SimplePie/Content/Type/Sniffer.php +++ b/library/SimplePie/Content/Type/Sniffer.php @@ -316,3 +316,5 @@ public function feed_or_html() return 'text/html'; } } + +class_alias('SimplePie_Content_Type_Sniffer', 'SimplePie\Content\Type\Sniffer', false); diff --git a/library/SimplePie/Copyright.php b/library/SimplePie/Copyright.php index 92f9b0947..e043ced8b 100644 --- a/library/SimplePie/Copyright.php +++ b/library/SimplePie/Copyright.php @@ -122,3 +122,5 @@ public function get_attribution() return null; } } + +class_alias('SimplePie_Copyright', 'SimplePie\Copyright', false); diff --git a/library/SimplePie/Credit.php b/library/SimplePie/Credit.php index d6ff07eba..347902e02 100644 --- a/library/SimplePie/Credit.php +++ b/library/SimplePie/Credit.php @@ -146,3 +146,5 @@ public function get_name() return null; } } + +class_alias('SimplePie_Credit', 'SimplePie\Credit', false); diff --git a/library/SimplePie/Enclosure.php b/library/SimplePie/Enclosure.php index 8a4cffa30..71cdd7d45 100644 --- a/library/SimplePie/Enclosure.php +++ b/library/SimplePie/Enclosure.php @@ -1307,3 +1307,5 @@ public function get_real_type($find_handler = false) return $type; } } + +class_alias('SimplePie_Enclosure', 'SimplePie\Enclosure', false); diff --git a/library/SimplePie/Exception.php b/library/SimplePie/Exception.php index 7a04c560c..715cefc72 100644 --- a/library/SimplePie/Exception.php +++ b/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/library/SimplePie/File.php b/library/SimplePie/File.php index c2d368b3b..7f894fb59 100644 --- a/library/SimplePie/File.php +++ b/library/SimplePie/File.php @@ -299,3 +299,5 @@ public function __construct($url, $timeout = 10, $redirects = 5, $headers = null } } } + +class_alias('SimplePie_File', 'SimplePie\File', false); diff --git a/library/SimplePie/HTTP/Parser.php b/library/SimplePie/HTTP/Parser.php index a4c48ddb7..b0f0f4a8b 100644 --- a/library/SimplePie/HTTP/Parser.php +++ b/library/SimplePie/HTTP/Parser.php @@ -518,3 +518,5 @@ static public function prepareHeaders($headers, $count = 1) return $data; } } + +class_alias('SimplePie_HTTP_Parser', 'SimplePie\HTTP\Parser', false); diff --git a/library/SimplePie/IRI.php b/library/SimplePie/IRI.php index a02de682c..6cd27ddba 100644 --- a/library/SimplePie/IRI.php +++ b/library/SimplePie/IRI.php @@ -1234,3 +1234,5 @@ protected function get_authority() return $iauthority; } } + +class_alias('SimplePie_IRI', 'SimplePie\IRI', false); diff --git a/library/SimplePie/Item.php b/library/SimplePie/Item.php index 3ac4fa882..02f158bfc 100644 --- a/library/SimplePie/Item.php +++ b/library/SimplePie/Item.php @@ -2965,3 +2965,5 @@ public function get_source() return null; } } + +class_alias('SimplePie_Item', 'SimplePie\Item', false); diff --git a/library/SimplePie/Locator.php b/library/SimplePie/Locator.php index c5fae0579..12961dd3d 100644 --- a/library/SimplePie/Locator.php +++ b/library/SimplePie/Locator.php @@ -430,3 +430,5 @@ public function body(&$array) return null; } } + +class_alias('SimplePie_Locator', 'SimplePie\Locator', false); diff --git a/library/SimplePie/Misc.php b/library/SimplePie/Misc.php index ce3cf0f54..4318573ba 100644 --- a/library/SimplePie/Misc.php +++ b/library/SimplePie/Misc.php @@ -2271,3 +2271,5 @@ public static function url_remove_credentials($url) return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url); } } + +class_alias('SimplePie_Misc', 'SimplePie\Misc', false); diff --git a/library/SimplePie/Net/IPv6.php b/library/SimplePie/Net/IPv6.php index 25c992bd1..c7e466a54 100644 --- a/library/SimplePie/Net/IPv6.php +++ b/library/SimplePie/Net/IPv6.php @@ -267,3 +267,5 @@ public static function checkIPv6($ip) return self::check_ipv6($ip); } } + +class_alias('SimplePie_Net_IPv6', 'SimplePie\Net\IPv6', false); diff --git a/library/SimplePie/Parse/Date.php b/library/SimplePie/Parse/Date.php index cf57437d2..fe7e3ea49 100644 --- a/library/SimplePie/Parse/Date.php +++ b/library/SimplePie/Parse/Date.php @@ -1023,3 +1023,5 @@ public function date_strtotime($date) return $strtotime; } } + +class_alias('SimplePie_Parse_Date', 'SimplePie\Parse\Date', false); diff --git a/library/SimplePie/Parser.php b/library/SimplePie/Parser.php index 3813b74b2..65f32d72a 100644 --- a/library/SimplePie/Parser.php +++ b/library/SimplePie/Parser.php @@ -677,3 +677,5 @@ private function declare_html_entities() { return ' ]>'; } } + +class_alias('SimplePie_Parser', 'SimplePie\Parser', false); diff --git a/library/SimplePie/Rating.php b/library/SimplePie/Rating.php index 599f75acb..eae6718a7 100644 --- a/library/SimplePie/Rating.php +++ b/library/SimplePie/Rating.php @@ -122,3 +122,5 @@ public function get_value() return null; } } + +class_alias('SimplePie_Rating', 'SimplePie\Rating', false); diff --git a/library/SimplePie/Registry.php b/library/SimplePie/Registry.php index 1aac51d07..2486f3c69 100755 --- a/library/SimplePie/Registry.php +++ b/library/SimplePie/Registry.php @@ -223,3 +223,5 @@ public function &call($type, $method, $parameters = array()) return $result; } } + +class_alias('SimplePie_Registry', 'SimplePie\Registry', false); diff --git a/library/SimplePie/Restriction.php b/library/SimplePie/Restriction.php index 950017fae..0a168bbbe 100644 --- a/library/SimplePie/Restriction.php +++ b/library/SimplePie/Restriction.php @@ -146,3 +146,5 @@ public function get_value() return null; } } + +class_alias('SimplePie_Restriction', 'SimplePie\Restriction', false); diff --git a/library/SimplePie/Sanitize.php b/library/SimplePie/Sanitize.php index 0ed3a5bda..988b57a8c 100644 --- a/library/SimplePie/Sanitize.php +++ b/library/SimplePie/Sanitize.php @@ -693,3 +693,5 @@ protected function add_attr($tag, $valuePairs, $document) } } } + +class_alias('SimplePie_Sanitize', 'SimplePie\Sanitize', false); diff --git a/library/SimplePie/Source.php b/library/SimplePie/Source.php index f14e5b220..9e7ddf04d 100644 --- a/library/SimplePie/Source.php +++ b/library/SimplePie/Source.php @@ -575,3 +575,5 @@ public function get_image_url() return null; } } + +class_alias('SimplePie_Source', 'SimplePie\Source', false); diff --git a/library/SimplePie/XML/Declaration/Parser.php b/library/SimplePie/XML/Declaration/Parser.php index 0c857a586..9ac088704 100644 --- a/library/SimplePie/XML/Declaration/Parser.php +++ b/library/SimplePie/XML/Declaration/Parser.php @@ -357,3 +357,5 @@ public function standalone_value() } } } + +class_alias('SimplePie_XML_Declaration_Parser', 'SimplePie\XML\Declaration\Parser', false); diff --git a/library/SimplePie/gzdecode.php b/library/SimplePie/gzdecode.php index 9c54f8833..030a230d0 100644 --- a/library/SimplePie/gzdecode.php +++ b/library/SimplePie/gzdecode.php @@ -364,3 +364,5 @@ public function parse() return false; } } + +class_alias('SimplePie_gzdecode', 'SimplePie\Gzdecode', false); diff --git a/src/Author.php b/src/Author.php new file mode 100644 index 000000000..19e92498e --- /dev/null +++ b/src/Author.php @@ -0,0 +1,55 @@ +assertTrue(class_exists('SimplePie\Author')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Author')); + } +} diff --git a/tests/Unit/Cache/BaseTest.php b/tests/Unit/Cache/BaseTest.php new file mode 100644 index 000000000..b5697bd62 --- /dev/null +++ b/tests/Unit/Cache/BaseTest.php @@ -0,0 +1,62 @@ +assertTrue(interface_exists('SimplePie\Cache\Base')); + } + + public function testClassExists() + { + $this->assertTrue(interface_exists('SimplePie_Cache_Base')); + } +} diff --git a/tests/Unit/Cache/DBTest.php b/tests/Unit/Cache/DBTest.php new file mode 100644 index 000000000..ef6f2401a --- /dev/null +++ b/tests/Unit/Cache/DBTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache\DB')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache_DB')); + } +} diff --git a/tests/Unit/Cache/FileTest.php b/tests/Unit/Cache/FileTest.php new file mode 100644 index 000000000..0dd322a29 --- /dev/null +++ b/tests/Unit/Cache/FileTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache\File')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache_File')); + } +} diff --git a/tests/Unit/Cache/MemcacheTest.php b/tests/Unit/Cache/MemcacheTest.php new file mode 100644 index 000000000..67ae47b1b --- /dev/null +++ b/tests/Unit/Cache/MemcacheTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache\Memcache')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache_Memcache')); + } +} diff --git a/tests/Unit/Cache/MemcachedTest.php b/tests/Unit/Cache/MemcachedTest.php new file mode 100644 index 000000000..78be4ff3f --- /dev/null +++ b/tests/Unit/Cache/MemcachedTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache\Memcached')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache_Memcached')); + } +} diff --git a/tests/Unit/Cache/MySQLTest.php b/tests/Unit/Cache/MySQLTest.php new file mode 100644 index 000000000..85e013298 --- /dev/null +++ b/tests/Unit/Cache/MySQLTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache\MySQL')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache_MySQL')); + } +} diff --git a/tests/Unit/Cache/RedisTest.php b/tests/Unit/Cache/RedisTest.php new file mode 100644 index 000000000..a19ff0b14 --- /dev/null +++ b/tests/Unit/Cache/RedisTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache\Redis')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache_Redis')); + } +} diff --git a/tests/Unit/CacheTest.php b/tests/Unit/CacheTest.php new file mode 100644 index 000000000..3cbb57920 --- /dev/null +++ b/tests/Unit/CacheTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Cache')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Cache')); + } +} diff --git a/tests/Unit/CaptionTest.php b/tests/Unit/CaptionTest.php new file mode 100644 index 000000000..90c12bab5 --- /dev/null +++ b/tests/Unit/CaptionTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Caption')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Caption')); + } +} diff --git a/tests/Unit/CategoryTest.php b/tests/Unit/CategoryTest.php new file mode 100644 index 000000000..58da3c8a9 --- /dev/null +++ b/tests/Unit/CategoryTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Category')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Category')); + } +} diff --git a/tests/Unit/Content/Type/SnifferTest.php b/tests/Unit/Content/Type/SnifferTest.php new file mode 100644 index 000000000..552c1bc94 --- /dev/null +++ b/tests/Unit/Content/Type/SnifferTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Content\Type\Sniffer')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Content_Type_Sniffer')); + } +} diff --git a/tests/Unit/CopyrightTest.php b/tests/Unit/CopyrightTest.php new file mode 100644 index 000000000..aae46a17f --- /dev/null +++ b/tests/Unit/CopyrightTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Copyright')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Copyright')); + } +} diff --git a/tests/Unit/CreditTest.php b/tests/Unit/CreditTest.php new file mode 100644 index 000000000..0888f6b83 --- /dev/null +++ b/tests/Unit/CreditTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Credit')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Credit')); + } +} diff --git a/tests/Unit/EnclosureTest.php b/tests/Unit/EnclosureTest.php new file mode 100644 index 000000000..cb20b0a7f --- /dev/null +++ b/tests/Unit/EnclosureTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Enclosure')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Enclosure')); + } +} diff --git a/tests/Unit/ExceptionTest.php b/tests/Unit/ExceptionTest.php new file mode 100644 index 000000000..974767ad6 --- /dev/null +++ b/tests/Unit/ExceptionTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Exception')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Exception')); + } +} diff --git a/tests/Unit/FileTest.php b/tests/Unit/FileTest.php new file mode 100644 index 000000000..f793cb5fe --- /dev/null +++ b/tests/Unit/FileTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\File')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_File')); + } +} diff --git a/tests/Unit/GzdecodeTest.php b/tests/Unit/GzdecodeTest.php new file mode 100644 index 000000000..445f16d5d --- /dev/null +++ b/tests/Unit/GzdecodeTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Gzdecode')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_gzdecode')); + } +} diff --git a/tests/Unit/HTTP/ParserTest.php b/tests/Unit/HTTP/ParserTest.php new file mode 100644 index 000000000..cd9a538ee --- /dev/null +++ b/tests/Unit/HTTP/ParserTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\HTTP\Parser')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_HTTP_Parser')); + } +} diff --git a/tests/Unit/IRITest.php b/tests/Unit/IRITest.php new file mode 100644 index 000000000..3282416d7 --- /dev/null +++ b/tests/Unit/IRITest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\IRI')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_IRI')); + } +} diff --git a/tests/Unit/ItemTest.php b/tests/Unit/ItemTest.php new file mode 100644 index 000000000..214d4a057 --- /dev/null +++ b/tests/Unit/ItemTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Item')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Item')); + } +} diff --git a/tests/Unit/LocatorTest.php b/tests/Unit/LocatorTest.php new file mode 100644 index 000000000..cb7675289 --- /dev/null +++ b/tests/Unit/LocatorTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Locator')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Locator')); + } +} diff --git a/tests/Unit/MiscTest.php b/tests/Unit/MiscTest.php new file mode 100644 index 000000000..889a81578 --- /dev/null +++ b/tests/Unit/MiscTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Misc')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Misc')); + } +} diff --git a/tests/Unit/Net/IPv6Test.php b/tests/Unit/Net/IPv6Test.php new file mode 100644 index 000000000..d74130c5a --- /dev/null +++ b/tests/Unit/Net/IPv6Test.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Net\IPv6')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Net_IPv6')); + } +} diff --git a/tests/Unit/Parse/DateTest.php b/tests/Unit/Parse/DateTest.php new file mode 100644 index 000000000..eeabc249d --- /dev/null +++ b/tests/Unit/Parse/DateTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Parse\Date')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Parse_Date')); + } +} diff --git a/tests/Unit/ParserTest.php b/tests/Unit/ParserTest.php new file mode 100644 index 000000000..276fd30bc --- /dev/null +++ b/tests/Unit/ParserTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Parser')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Parser')); + } +} diff --git a/tests/Unit/RatingTest.php b/tests/Unit/RatingTest.php new file mode 100644 index 000000000..62f598518 --- /dev/null +++ b/tests/Unit/RatingTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Rating')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Rating')); + } +} diff --git a/tests/Unit/RegistryTest.php b/tests/Unit/RegistryTest.php new file mode 100644 index 000000000..fe74e0ad3 --- /dev/null +++ b/tests/Unit/RegistryTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Registry')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Registry')); + } +} diff --git a/tests/Unit/RestrictionTest.php b/tests/Unit/RestrictionTest.php new file mode 100644 index 000000000..e739eaabb --- /dev/null +++ b/tests/Unit/RestrictionTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Restriction')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Restriction')); + } +} diff --git a/tests/Unit/SanitizeTest.php b/tests/Unit/SanitizeTest.php new file mode 100644 index 000000000..0ca9b3f6d --- /dev/null +++ b/tests/Unit/SanitizeTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Sanitize')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Sanitize')); + } +} diff --git a/tests/Unit/SimplePieTest.php b/tests/Unit/SimplePieTest.php new file mode 100644 index 000000000..4a081b846 --- /dev/null +++ b/tests/Unit/SimplePieTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\SimplePie')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie')); + } +} diff --git a/tests/Unit/SourceTest.php b/tests/Unit/SourceTest.php new file mode 100644 index 000000000..f47ad3add --- /dev/null +++ b/tests/Unit/SourceTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\Source')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_Source')); + } +} diff --git a/tests/Unit/XML/Declaration/ParserTest.php b/tests/Unit/XML/Declaration/ParserTest.php new file mode 100644 index 000000000..fb47b8089 --- /dev/null +++ b/tests/Unit/XML/Declaration/ParserTest.php @@ -0,0 +1,62 @@ +assertTrue(class_exists('SimplePie\XML\Declaration\Parser')); + } + + public function testClassExists() + { + $this->assertTrue(class_exists('SimplePie_XML_Declaration_Parser')); + } +} From dacf0ed495d2e8fb306e526ca3f2a846af78a7c9 Mon Sep 17 00:00:00 2001 From: rdalverny Date: Thu, 3 Mar 2022 01:29:14 +0100 Subject: [PATCH 06/44] Add audio, video @src elements/attribute for URL resolution (#716) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add audio, video @src elements/attribute for URL resolution Independently from enclosures, it happens that audio/video contents are also embedded through `