From cb36fe25a75b764e020760fd0d918bea13cadd13 Mon Sep 17 00:00:00 2001 From: maTh Date: Sat, 5 Feb 2022 14:15:32 +0100 Subject: Improved: Fetch articles with selector but do not delete the class attribute. (Simplepie: new method: rename_attribute) (#4175) * added to simplepie: rename_attributes * rename the class attribute * Update lib/SimplePie/SimplePie/Sanitize.php Co-authored-by: Alexandre Alapetite * added 'id' as attribute to rename to 'data-sanitized-id' * Update lib_rss.php * source code in sync with simplepie upstream * fixed parameters Co-authored-by: Alexandre Alapetite --- lib/SimplePie/SimplePie.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/SimplePie/SimplePie.php') diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php index 4a02b2973..b0e973e83 100644 --- a/lib/SimplePie/SimplePie.php +++ b/lib/SimplePie/SimplePie.php @@ -656,6 +656,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 tags to be stripped 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 @@ -1235,6 +1242,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 === '') -- cgit v1.2.3