X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/extensions/SyntaxHighlight_GeSHi/tests/parserTests.txt diff --git a/extensions/SyntaxHighlight_GeSHi/tests/parserTests.txt b/extensions/SyntaxHighlight_GeSHi/tests/parserTests.txt new file mode 100644 index 00000000..8864c2d6 --- /dev/null +++ b/extensions/SyntaxHighlight_GeSHi/tests/parserTests.txt @@ -0,0 +1,164 @@ +!! hooks +source +!! endhooks + +!! test +Non-existent language +!!input + +foobar + +!! result +
foobar
+ +!! end + +!! test +No language specified +!! wikitext + +foo + +!! html +
foo
+ +!! end + +!! test +No language specified (no wellformed xml) +!! config +!! wikitext + +bar + +!! html +
bar
+ +!! end + +!! test +XSS is escaped +!!input + + + + +%253cscript%253ealert(document.cookie)%253c/script%253e + +!! result +
<script>alert("pwnd")</script>
+<IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>
+<IMG
+SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;
+&#39;&#88;&#83;&#83;&#39;&#41;
+\";alert('XSS');//
+</script><script>alert('XSS');</script>
+%253cscript%253ealert(document.cookie)%253c/script%253e
+ +!! end + +!! test +XSS is escaped (inline) +!!input + + + + +%253cscript%253ealert(document.cookie)%253c/script%253e + +!! result +

<script>alert("pwnd")</script> <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`> <IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40; &#39;&#88;&#83;&#83;&#39;&#41; \";alert('XSS');// </script><script>alert('XSS');</script> %253cscript%253ealert(document.cookie)%253c/script%253e +

+!! end + +!! test +Default behaviour (inner is pre) +!!input + +var a; + +!! result +
var a;
+
+ +!! end + +!! test +Multiline in lists +!!input +* a +b + +* foo a +b +!! html + + + +!! html+tidy + + +!! end + +!! test +Custom attributes +!!input +var a; +!! result +
var a;
+
+ +!! end + +!! test +Inline attribute (inline code) +!!input +Text var a;. +!! result +

Text var a;. +

+!! end + +!! test +Enclose none (inline code) +!!input +Text var a;. +!! result +

Text var a;. +

+!! end + +!! test +Enclose with nowiki +!! input +{{#tag:syntaxhighlight|foo|lang="text"|inline=none}} +!! result +

foo +

+!! end