diff options
author | friendica <info@friendica.com> | 2012-05-12 17:57:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-18 20:40:31 +1000 |
commit | 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a (patch) | |
tree | a9c3d91209cff770bb4b613b1b95e61a7bbc5a2b /lib/htmlpurifier/tests/HTMLPurifier/HTMLT | |
parent | cd727cb26b78a1dade09d510b071446898477356 (diff) | |
download | volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.tar.gz volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.tar.bz2 volse-hubzilla-7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a.zip |
some important stuff we'll need
Diffstat (limited to 'lib/htmlpurifier/tests/HTMLPurifier/HTMLT')
43 files changed, 364 insertions, 0 deletions
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-preserve.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-preserve.htmlt new file mode 100644 index 000000000..650f00b6b --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-preserve.htmlt @@ -0,0 +1,8 @@ +--INI-- +HTML.AllowedElements = b,i,p,a +HTML.AllowedAttributes = a.href,*.id +--HTML-- +<p>Par.</p> +<p>Para<a href="http://google.com/">gr</a>aph</p> +Text<b>Bol<i>d</i></b> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-remove.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-remove.htmlt new file mode 100644 index 000000000..2b6b8eea6 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-remove.htmlt @@ -0,0 +1,8 @@ +--INI-- +HTML.AllowedElements = b,i,p,a +HTML.AllowedAttributes = a.href,*.id +--HTML-- +<span>Not allowed</span><a class="mef" id="foobar">Remove id too!</a> +--EXPECT-- +Not allowed<a>Remove id too!</a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/basic.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/basic.htmlt new file mode 100644 index 000000000..4c1f42778 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/basic.htmlt @@ -0,0 +1,5 @@ +--HTML-- +<b>basic</b> +--EXPECT-- +<b>basic</b> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-preserve.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-preserve.htmlt new file mode 100644 index 000000000..d8882fe22 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-preserve.htmlt @@ -0,0 +1,6 @@ +--INI-- +HTML.ForbiddenElements = b +HTML.ForbiddenAttributes = a@href +--HTML-- +<p>foo</p> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-remove.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-remove.htmlt new file mode 100644 index 000000000..1b5985873 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-remove.htmlt @@ -0,0 +1,8 @@ +--INI-- +HTML.ForbiddenElements = b +HTML.ForbiddenAttributes = a@href +--HTML-- +<b>Foo<a href="bar">bar</a></b> +--EXPECT-- +Foo<a>bar</a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-preserve.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-preserve.htmlt new file mode 100644 index 000000000..a5fe3f849 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-preserve.htmlt @@ -0,0 +1,5 @@ +--INI-- +CSS.AllowedProperties = color,background-color +--HTML-- +<div style="color:#f00;background-color:#ded;">red</div> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-remove.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-remove.htmlt new file mode 100644 index 000000000..644b7001a --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-remove.htmlt @@ -0,0 +1,7 @@ +--INI-- +CSS.AllowedProperties = color,background-color +--HTML-- +<div style="color:#f00;border:1px solid #000">red</div> +--EXPECT-- +<div style="color:#f00;">red</div> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/disable-uri.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/disable-uri.htmlt new file mode 100644 index 000000000..fa692e444 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/disable-uri.htmlt @@ -0,0 +1,6 @@ +--INI-- +URI.Disable = true +--HTML-- +<img src="foobar" /> +--EXPECT-- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/double-youtube.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/double-youtube.htmlt new file mode 100644 index 000000000..a46ce4736 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/double-youtube.htmlt @@ -0,0 +1,6 @@ +--INI-- +HTML.SafeObject = true +Output.FlashCompat = true +--HTML-- +<object width="425" height="350" data="http://www.youtube.com/v/BdU--T8rLns" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><param name="movie" value="http://www.youtube.com/v/BdU--T8rLns" /><param name="wmode" value="window" /></object> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/empty.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/empty.htmlt new file mode 100644 index 000000000..9094c47b0 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/empty.htmlt @@ -0,0 +1,6 @@ +--INI-- + +--HTML-- + +--EXPECT-- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/file-uri.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/file-uri.htmlt new file mode 100644 index 000000000..5b9e34a8c --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/file-uri.htmlt @@ -0,0 +1,5 @@ +--INI-- +URI.AllowedSchemes = file +--HTML-- +<a href="file:///foo">foo</a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-default.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-default.htmlt new file mode 100644 index 000000000..1c1460f2c --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-default.htmlt @@ -0,0 +1,5 @@ +--HTML-- +<span id="moon">foobar</span> +--EXPECT-- +<span>foobar</span> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-enabled.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-enabled.htmlt new file mode 100644 index 000000000..70ddcf99f --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-enabled.htmlt @@ -0,0 +1,6 @@ +--INI-- +Attr.EnableID = true +--HTML-- +<span id="moon">foobar</span> +<img id="folly" src="folly.png" alt="Omigosh!" /> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-img.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-img.htmlt new file mode 100644 index 000000000..12755bea3 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-img.htmlt @@ -0,0 +1,8 @@ +--INI-- +Attr.EnableID = true +Core.LexerImpl = DirectLex +--HTML-- +<img src="img_11775.jpg" alt="[Img #11775]" id="EMBEDDED_IMG_11775" > +--EXPECT-- +<img src="img_11775.jpg" alt="[Img #11775]" id="EMBEDDED_IMG_11775" /> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-name-mix.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-name-mix.htmlt new file mode 100644 index 000000000..a48da8e62 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/id-name-mix.htmlt @@ -0,0 +1,11 @@ +--INI-- +Attr.EnableID = true +--HTML-- +<a name="foo" id="foo">Test</a> +<a name="foo">Test2</a> +<a name="bar" id="baz">Test3</a> +--EXPECT-- +<a name="foo" id="foo">Test</a> +<a>Test2</a> +<a name="bar" id="baz">Test3</a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-list-loop.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-list-loop.htmlt new file mode 100644 index 000000000..0a63e8955 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-list-loop.htmlt @@ -0,0 +1,5 @@ +--HTML-- +<i><ul></ul></i> +--EXPECT-- +<i></i><i></i> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-wraps-block.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-wraps-block.htmlt new file mode 100644 index 000000000..da6bae689 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-wraps-block.htmlt @@ -0,0 +1,5 @@ +--HTML-- +<a href="foo.html"><h1>Foobar</h1></a> +--EXPECT-- +<a href="foo.html"></a><h1><a href="foo.html">Foobar</a></h1><a href="foo.html"></a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/list-nesting.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/list-nesting.htmlt new file mode 100644 index 000000000..22ebf6058 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/list-nesting.htmlt @@ -0,0 +1,5 @@ +--HTML-- +<ul><li>Sublist 1</li><ul><li>Bullet</li></ul></ul> +--EXPECT-- +<ul><li>Sublist 1<ul><li>Bullet</li></ul></li></ul> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/munge-extra.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/munge-extra.htmlt new file mode 100644 index 000000000..4b1c70a9d --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/munge-extra.htmlt @@ -0,0 +1,11 @@ +--INI-- +URI.Munge = "/redirect?s=%s&t=%t&r=%r&n=%n&m=%m&p=%p" +URI.MungeSecretKey = "foo" +URI.MungeResources = true +--HTML-- +<a href="http://example.com">Link</a> +<img src="http://example.com" style="background-image:url(http://example.com);" alt="example.com" /> +--EXPECT-- +<a href="/redirect?s=http%3A%2F%2Fexample.com&t=c15354f3953dfec262c55b1403067e0d045a3059&r=&n=a&m=href&p=">Link</a> +<img src="/redirect?s=http%3A%2F%2Fexample.com&t=c15354f3953dfec262c55b1403067e0d045a3059&r=1&n=img&m=src&p=" style="background-image:url("/redirect?s=http%3A%2F%2Fexample.com&t=c15354f3953dfec262c55b1403067e0d045a3059&r=1&n=img&m=style&p=background-image");" alt="example.com" /> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/munge.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/munge.htmlt new file mode 100644 index 000000000..827c216e6 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/munge.htmlt @@ -0,0 +1,52 @@ +--INI-- +URI.Munge = "/r/%s" +URI.AllowedSchemes = http,ftp,file +--HTML-- +<a href="google.com">foo</a> +<a href="/google.com">foo</a> +<a href="//google.com">foo</a> +<a href="///google.com">foo</a> +<a href="////google.com">foo</a> + +<a href="http:google.com">foo</a> +<a href="http:/google.com">foo</a> +<a href="http://google.com">foo</a> +<a href="http:///google.com">foo</a> +<a href="http:////google.com">foo</a> + +<a href="ftp:google.com">foo</a> +<a href="ftp:/google.com">foo</a> +<a href="ftp://google.com">foo</a> +<a href="ftp:///google.com">foo</a> +<a href="ftp:////google.com">foo</a> + +<a href="file:google.com">foo</a> +<a href="file:/google.com">foo</a> +<a href="file://google.com">foo</a> +<a href="file:///google.com">foo</a> +<a href="file:////google.com">foo</a> +--EXPECT-- +<a href="google.com">foo</a> +<a href="/google.com">foo</a> +<a href="/r/%2F%2Fgoogle.com">foo</a> +<a href="/google.com">foo</a> +<a>foo</a> + +<a href="google.com">foo</a> +<a href="/google.com">foo</a> +<a href="/r/http%3A%2F%2Fgoogle.com">foo</a> +<a href="/google.com">foo</a> +<a>foo</a> + +<a>foo</a> +<a>foo</a> +<a href="/r/ftp%3A%2F%2Fgoogle.com">foo</a> +<a>foo</a> +<a>foo</a> + +<a href="file:google.com">foo</a> +<a href="file:/google.com">foo</a> +<a href="file://google.com">foo</a> +<a href="file:///google.com">foo</a> +<a href="file:////google.com">foo</a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/name.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/name.htmlt new file mode 100644 index 000000000..1713ed417 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/name.htmlt @@ -0,0 +1,6 @@ +--INI-- +Attr.EnableID = true +HTML.Doctype = "XHTML 1.0 Strict" +--HTML-- +<a name="asdf"></a> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-googlemaps.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-googlemaps.htmlt new file mode 100644 index 000000000..40fac62d5 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-googlemaps.htmlt @@ -0,0 +1,8 @@ +--INI-- +HTML.SafeIframe = true +URI.SafeIframeRegexp = "%^http://maps.google.com/%" +--HTML-- +<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&ll=37.0625,-95.677068&spn=24.455808,37.353516&z=4&output=embed"></iframe> +--EXPECT-- +<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&ll=37.0625,-95.677068&spn=24.455808,37.353516&z=4&output=embed"></iframe> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-invalid.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-invalid.htmlt new file mode 100644 index 000000000..5b366da54 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-invalid.htmlt @@ -0,0 +1,7 @@ +--INI-- +HTML.SafeIframe = true +--HTML-- +<iframe src="http://www.example.com/"></iframe> +--EXPECT-- +<iframe></iframe> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-youtube.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-youtube.htmlt new file mode 100644 index 000000000..1abc2c827 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-youtube.htmlt @@ -0,0 +1,8 @@ +--INI-- +HTML.SafeIframe = true +URI.SafeIframeRegexp = "%^http://www.youtube.com/embed/%" +--HTML-- +<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/RVtEQxH7PWA" frameborder="0" allowfullscreen></iframe> +--EXPECT-- +<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/RVtEQxH7PWA" frameborder="0"></iframe> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe.htmlt new file mode 100644 index 000000000..7c0b60d2f --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe.htmlt @@ -0,0 +1,14 @@ +--INI-- +HTML.SafeIframe = true +URI.SafeIframeRegexp = "%(^http://www.example.com/|^https?://dev.example.com/)%" +--HTML-- +<iframe src="http://www.example.com/"></iframe> +<iframe src="http://malicious.host.com/?http://www.example.com/"></iframe> +<iframe src="http://dev.example.com/"></iframe> +<iframe src="https://dev.example.com/"></iframe> +--EXPECT-- +<iframe src="http://www.example.com/"></iframe> +<iframe></iframe> +<iframe src="http://dev.example.com/"></iframe> +<iframe src="https://dev.example.com/"></iframe> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed-munge.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed-munge.htmlt new file mode 100644 index 000000000..77b32d3a1 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed-munge.htmlt @@ -0,0 +1,10 @@ +--INI-- +HTML.SafeObject = true +HTML.SafeEmbed = true +URI.Munge = "/redirect.php?url=%s&check=%t" +URI.MungeSecretKey = "foo" +--HTML-- +<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en"></param><embed src="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" type="application/x-shockwave-flash" width="425" height="344"></embed></object> +--EXPECT-- +<object width="425" height="344" data="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><param name="movie" value="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" /><embed src="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" type="application/x-shockwave-flash" width="425" height="344" allowscriptaccess="never" allownetworking="internal" /></object> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed.htmlt new file mode 100644 index 000000000..f4bb0ff09 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed.htmlt @@ -0,0 +1,8 @@ +--INI-- +HTML.SafeObject = true +HTML.SafeEmbed = true +--HTML-- +<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en"></param><embed src="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" type="application/x-shockwave-flash" width="425" height="344"></embed></object> +--EXPECT-- +<object width="425" height="344" data="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><param name="movie" value="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" /><embed src="http://www.youtube.com/v/Oq3FV_zdyy0&hl=en" type="application/x-shockwave-flash" width="425" height="344" allowscriptaccess="never" allownetworking="internal" /></object> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-bare.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-bare.htmlt new file mode 100644 index 000000000..f85c2fb5e --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-bare.htmlt @@ -0,0 +1,9 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<script type="text/javascript">alert("<This is compatible with XHTML>");</script> +--EXPECT-- +<script type="text/javascript"><!--//--><![CDATA[//><!-- +alert("<This is compatible with XHTML>"); +//--><!]]></script> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-cdata.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-cdata.htmlt new file mode 100644 index 000000000..e7d6d7f5b --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-cdata.htmlt @@ -0,0 +1,11 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<script type="text/javascript"><![CDATA[ +alert("<This is compatible with XHTML>"); +]]></script> +--EXPECT-- +<script type="text/javascript"><!--//--><![CDATA[//><!-- +alert("<This is compatible with XHTML>"); +//--><!]]></script> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-comment.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-comment.htmlt new file mode 100644 index 000000000..006901919 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-comment.htmlt @@ -0,0 +1,11 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<script type="text/javascript"><!-- +alert("<This is compatible with XHTML>"); +//--></script> +--EXPECT-- +<script type="text/javascript"><!--//--><![CDATA[//><!-- +alert("<This is compatible with XHTML>"); +//--><!]]></script> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-dbl-comment.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-dbl-comment.htmlt new file mode 100644 index 000000000..ef899b597 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-dbl-comment.htmlt @@ -0,0 +1,11 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<script type="text/javascript"><![CDATA[ +alert("<This is compatible with XHTML>"); +//]]></script> +--EXPECT-- +<script type="text/javascript"><!--//--><![CDATA[//><!-- +alert("<This is compatible with XHTML>"); +//--><!]]></script> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-ideal.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-ideal.htmlt new file mode 100644 index 000000000..70510687c --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/script-ideal.htmlt @@ -0,0 +1,11 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<script type="text/javascript"><!--//--><![CDATA[//><!-- +alert("<This is compatible with XHTML>"); +//--><!]]></script> +--EXPECT-- +<script type="text/javascript"><!--//--><![CDATA[//><!-- +alert("<This is compatible with XHTML>"); +//--><!]]></script> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/secure-munge.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/secure-munge.htmlt new file mode 100644 index 000000000..114cb0000 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/secure-munge.htmlt @@ -0,0 +1,10 @@ +--INI-- +URI.Munge = "/redirect.php?url=%s&check=%t" +URI.MungeSecretKey = "foo" +--HTML-- +<a href="http://localhost">foo</a> +<img src="http://localhost" alt="local" /> +--EXPECT-- +<a href="/redirect.php?url=http%3A%2F%2Flocalhost&check=8e8223ae8fac24561104180ea549c21fbd111be7">foo</a> +<img src="http://localhost" alt="local" /> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-preserve-yen.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-preserve-yen.htmlt new file mode 100644 index 000000000..f22417c01 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-preserve-yen.htmlt @@ -0,0 +1,8 @@ +--SKIPIF-- +if (!function_exists('iconv')) return true; +--INI-- +Core.Encoding = "Shift_JIS" +Core.EscapeNonASCIICharacters = true +--HTML-- +<b style="font-family:'¥';">111</b> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-remove-yen.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-remove-yen.htmlt new file mode 100644 index 000000000..6c2d3bc4c --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-remove-yen.htmlt @@ -0,0 +1,9 @@ +--SKIPIF-- +if (!function_exists('iconv')) return true; +--INI-- +Core.Encoding = Shift_JIS +--HTML-- +<b style="font-family:'¥';">111</b> +--EXPECT-- +<b style="font-family:'';">111</b> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote-with-inline.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote-with-inline.htmlt new file mode 100644 index 000000000..a6eb0ec66 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote-with-inline.htmlt @@ -0,0 +1,7 @@ +--INI-- +HTML.Doctype = "XHTML 1.0 Strict" +--HTML-- +<blockquote>Illegal <b>contents</b></blockquote> +--EXPECT-- +<blockquote><p>Illegal <b>contents</b></p></blockquote> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote.htmlt new file mode 100644 index 000000000..b61e8dc07 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote.htmlt @@ -0,0 +1,7 @@ +--INI-- +HTML.Strict = true +--HTML-- +<blockquote>Illegal contents</blockquote> +--EXPECT-- +<blockquote><p>Illegal contents</p></blockquote> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-underline.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-underline.htmlt new file mode 100644 index 000000000..a2e18b1c9 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-underline.htmlt @@ -0,0 +1,7 @@ +--INI-- +HTML.Strict = true +--HTML-- +<u>Illegal underline</u> +--EXPECT-- +<span style="text-decoration:underline;">Illegal underline</span> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/tidy-background.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/tidy-background.htmlt new file mode 100644 index 000000000..08bda2678 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/tidy-background.htmlt @@ -0,0 +1,5 @@ +--HTML-- +<table background="logo.png"><tr><td>asdf</td></tr></table> +--EXPECT-- +<table style="background-image:url("logo.png");"><tr><td>asdf</td></tr></table> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments-required.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments-required.htmlt new file mode 100644 index 000000000..62dc159d0 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments-required.htmlt @@ -0,0 +1,6 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<ul><!-- Foo --></ul> +--EXPECT-- +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments-table.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments-table.htmlt new file mode 100644 index 000000000..89d80febf --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments-table.htmlt @@ -0,0 +1,5 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<table><!-- foo --><tr><td>Foo</td></tr></table> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments.htmlt new file mode 100644 index 000000000..93b4a35a6 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/trusted-comments.htmlt @@ -0,0 +1,5 @@ +--INI-- +HTML.Trusted = true +--HTML-- +<!-- Foobar --> +--# vim: et sw=4 sts=4 diff --git a/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/whitespace-preserve.htmlt b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/whitespace-preserve.htmlt new file mode 100644 index 000000000..861bddaf4 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/HTMLT/whitespace-preserve.htmlt @@ -0,0 +1,3 @@ +--HTML-- +Foo<b> </b>bar +--# vim: et sw=4 sts=4 |