summaryrefslogtreecommitdiffstats
path: root/tests/feeds
diff options
context:
space:
mode:
authorRomain d'Alverny <rdalverny@gmail.com>2022-01-12 14:46:01 +0100
committerRomain d'Alverny <rdalverny@gmail.com>2022-01-12 14:46:01 +0100
commit0b2f80b2504286f0f9b9e1b95db5244d414a6808 (patch)
treea1f7095522eb124f37b8c7468b6138040e4bb025 /tests/feeds
parentca75bfdcf9888a73105228e03316920edaf44ff2 (diff)
downloadplanet-0b2f80b2504286f0f9b9e1b95db5244d414a6808.tar
planet-0b2f80b2504286f0f9b9e1b95db5244d414a6808.tar.gz
planet-0b2f80b2504286f0f9b9e1b95db5244d414a6808.tar.bz2
planet-0b2f80b2504286f0f9b9e1b95db5244d414a6808.tar.xz
planet-0b2f80b2504286f0f9b9e1b95db5244d414a6808.zip
Sanitize some HTML tags while in fast parsing mode
It's almost the same config as `set_stupidly_fast(true)` only we don't want to touch at `add_attributes` (because it's valuable safety) and we do want to strip specific tags (among which <script>, see moonmoon/moonmoon#111).
Diffstat (limited to 'tests/feeds')
-rw-r--r--tests/feeds/feed-rss2.rss76
1 files changed, 76 insertions, 0 deletions
diff --git a/tests/feeds/feed-rss2.rss b/tests/feeds/feed-rss2.rss
new file mode 100644
index 0000000..312998b
--- /dev/null
+++ b/tests/feeds/feed-rss2.rss
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+ xmlns:media="http://search.yahoo.com/mrss/"
+ version="2.0">
+<channel>
+ <title>Test Feed</title>
+ <link>https://blog.example.com</link>
+ <description>some description</description>
+ <lastBuildDate>Fri, 03 Dec 2021 18:41:33 +0000</lastBuildDate>
+ <language>fr-FR</language>
+ <sy:updatePeriod>hourly</sy:updatePeriod>
+ <sy:updateFrequency>1</sy:updateFrequency>
+ <generator>https://generator.example.com/?v=1.2.3</generator>
+ <image>
+ <url></url>
+ <title>Test Feed</title>
+ <link>https://blog.example.com</link>
+ <width>32</width>
+ <height>32</height>
+ </image>
+ <item>
+ <title>Test Post</title>
+ <link>https://blog.example.com/2022/01/test-post/</link>
+ <comments>https://blog.example.com/2022/01/test-post/#respond</comments>
+ <pubDate>Fri, 03 Dec 2021 18:41:29 +0000</pubDate>
+ <dc:creator><![CDATA[Creator]]></dc:creator>
+ <category><![CDATA[Non classé]]></category>
+ <guid isPermaLink="false">https://blog.example.com/?p=3863</guid>
+ <description><![CDATA[Blabla.]]></description>
+ <enclosure url="https://blog.example.com/wp-content/uploads/2022/01/1.jpg" length="39073" type="image/jpeg" />
+ <media:content url="https://blog.example.com/wp-content/uploads/2022/01/2.jpg" width="700" height="699" medium="image" type="image/jpeg" />
+ </item>
+ <item>
+ <title>Test Post With JavaScript</title>
+ <link>https://blog.example.com/2022/01/test-post-js/</link>
+ <comments>https://github.com/moonmoon/moonmoon/issues/111</comments>
+ <pubDate>Fri, 03 Dec 2021 18:41:30 +0000</pubDate>
+ <dc:creator><![CDATA[Creator]]></dc:creator>
+ <category><![CDATA[Non classé]]></category>
+ <guid isPermaLink="false">https://blog.example.com/?p=3864</guid>
+ <description><![CDATA[Blabla. <script>document.location.replace('https://example.com');</script> Ho. Ho. Ho.]]></description>
+ </item>
+ <item>
+ <title>Test Post With Image Relative Tag</title>
+ <link>https://blog.example.com/2022/01/test-post-img-tag-rel/</link>
+ <comments>https://github.com/moonmoon/moonmoon/issues/112</comments>
+ <pubDate>Fri, 03 Dec 2021 18:41:31 +0000</pubDate>
+ <dc:creator><![CDATA[Creator]]></dc:creator>
+ <category><![CDATA[Non classé]]></category>
+ <guid isPermaLink="false">https://blog.example.com/?p=3865</guid>
+ <description><![CDATA[Image relative: <img src="data/images/jjg.jpg" />]]></description>
+ </item>
+ <item>
+ <title>Test Post With Audio Relative Tag</title>
+ <link>https://blog.example.com/2022/01/test-post-audio-tag-rel/</link>
+ <comments>https://github.com/moonmoon/moonmoon/issues/112</comments>
+ <pubDate>Fri, 03 Dec 2021 18:41:32 +0000</pubDate>
+ <dc:creator><![CDATA[Creator]]></dc:creator>
+ <category><![CDATA[Non classé]]></category>
+ <guid isPermaLink="false">https://blog.example.com/?p=3866</guid>
+ <description><![CDATA[Audio relatif: <audio src="/data/documents/jjg.mp3" type="audio/mp3" controls="controls">]]></description>
+ </item>
+ <item>
+ <title>Test Post With Video Source Relative Tag</title>
+ <link>https://blog.example.com/2022/01/test-post-video-tag-rel/</link>
+ <comments>https://github.com/moonmoon/moonmoon/issues/112</comments>
+ <pubDate>Fri, 03 Dec 2021 18:41:33 +0000</pubDate>
+ <dc:creator><![CDATA[Creator]]></dc:creator>
+ <category><![CDATA[Non classé]]></category>
+ <guid isPermaLink="false">https://blog.example.com/?p=3867@</guid>
+ <description><![CDATA[Video relative: <video><source src="/data/documents/jjg.mpeg"></video>]]></description>
+ </item>
+</channel>
+</rss> \ No newline at end of file