[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Tweak Sanitizer test to pass in PHP; also add new test for T...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/396059 ) Change subject: Tweak Sanitizer test to pass in PHP; also add new test for T182338 .. Tweak Sanitizer test to pass in PHP; also add new test for T182338 Change-Id: Id5c899dd24004ed205807547db6ded26bee2df46 --- M tests/parserTests-blacklist.js M tests/parserTests.txt 2 files changed, 35 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Arlolra: Looks good to me, approved diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js index d9f5409..751e385 100644 --- a/tests/parserTests-blacklist.js +++ b/tests/parserTests-blacklist.js @@ -151,6 +151,7 @@ add("wt2html", "CSS line continuation 2", ""); add("wt2html", "Sanitizer: Closing of closed but not open table tags", "Table not started"); add("wt2html", "Sanitizer: Validating that and work, but only for Microdata", "\n\tmeta itemprop=\"hello\" content=\"world\">\n\tmeta http-equiv=\"refresh\" content=\"5\">\n\tmeta itemprop=\"hello\" http-equiv=\"refresh\" content=\"5\">\n\tlink itemprop=\"hello\" href=\"{{SERVER}}\">\n\tlink rel=\"stylesheet\" href=\"{{SERVER}}\">\n\tlink rel=\"stylesheet\" itemprop=\"hello\" href=\"{{SERVER}}\">\n"); +add("wt2html", "Sanitizer: angle brackets are invalid, even in interwiki links (T182338)", "http://www.usemod.com/cgi-bin/mb.pl?FooBar\; title=\"meatball:FooBar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?FooBar\"},\"sa\":{\"href\":\"meatball:FooBar\"},\"isIW\":true,\"dsr\":[0,20,2,2]}'>meatball:FooBar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\" title=\"meatball:Foo>Bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\"},\"sa\":{\"href\":\"meatball:Foo>Bar\"},\"isIW\":true,\"dsr\":[21,41,2,2]}'>meatball:Foo>Bar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foobar\; title=\"meatball:Foobar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foobar\"},\"sa\":{\"href\":\"meatball:Foolt;bar\"},\"isIW\":true,\"dsr\":[42,65,2,2]}'>meatball:Foobar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>bar\" title=\"meatball:Foo>bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>bar\"},\"sa\":{\"href\":\"meatball:Foogt;bar\"},\"isIW\":true,\"dsr\":[66,89,2,2]}'>meatball:Foo>bar"); add("wt2html", "Language converter glossary rules inside attributes (T119158)", "\n\n"); add("wt2html", "Inline HTML vs wiki block nesting", "Bold paragraph\n\nNew wiki paragraph"); add("wt2html", "Special page transclusion", "{{Special:Prefixindex/Xyzzyx}}"); @@ -417,6 +418,7 @@ add("html2html", "CSS line continuation 2", "\n"); add("html2html", "Parser hook: nested tags", "/tag>"); add("html2html", "Sanitizer: Validating that and work, but only for Microdata", "\n\tmeta itemprop=\"hello\" content=\"world\" />\n\tmeta http-equiv=\"refresh\" content=\"5\">\n\tmeta itemprop=\"hello\" content=\"5\" />\n\thttp://example.org\; data-parsoid='{\"targetOff\":162,\"contentOffsets\":[162,162],\"dsr\":[143,163,19,1]}'>\n\tlink rel=\"stylesheet\" href=\"http://example.org\;>\n\thttp://example.org\; data-parsoid='{\"targetOff\":235,\"contentOffsets\":[235,235],\"dsr\":[216,236,19,1]}'>\n\n\n"); +add("html2html", "Sanitizer: angle brackets are invalid, even in interwiki links (T182338)", "http://www.usemod.com/cgi-bin/mb.pl?FooBar\; title=\"meatball:FooBar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?FooBar\"},\"sa\":{\"href\":\"meatball:FooBar\"},\"isIW\":true,\"dsr\":[0,20,2,2]}'>meatball:FooBar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\" title=\"meatball:Foo>Bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\"},\"sa\":{\"href\":\"meatball:Foo>Bar\"},\"isIW\":true,\"dsr\":[21,41,2,2]}'>meatball:Foo>Bar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foobar\; title=\"meatball:Foobar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foobar\"},\"sa\":{\"href\":\"meatball:Foobar\"},\"isIW\":true,\"dsr\":[42,62,2,2]}'>meatball:Foobar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>bar\" title=\"meatball:Foo>bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>bar\"},\"sa\":{\"href\":\"meatball:Foo>bar\"},\"isIW\":true,\"dsr\":[63,83,2,2]}'>meatball:Foo>bar\n"); add("html2html", "Language converter glossary rules inside attributes (T119158)", "\n\n"); add("html2html", "HTML ordered list item with parameters oddity", " One\n"); add("html2html", "Special page transclusion", " Xyzzyx\n"); @@ -866,6 +868,7 @@ add("html2wt", "Sanitizer: Closing of open tags", "\n{|\n|}\n"); add("html2wt", "Sanitizer: Closing of open but not closed tags", "foo\n"); add("html2wt", "Sanitizer: Validating that and
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Tweak Sanitizer test to pass in PHP; also add new test for T...
C. Scott Ananian has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396059 ) Change subject: Tweak Sanitizer test to pass in PHP; also add new test for T182338 .. Tweak Sanitizer test to pass in PHP; also add new test for T182338 Change-Id: Id5c899dd24004ed205807547db6ded26bee2df46 --- M tests/parserTests-blacklist.js M tests/parserTests.txt 2 files changed, 30 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/59/396059/1 diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js index d9f5409..751e385 100644 --- a/tests/parserTests-blacklist.js +++ b/tests/parserTests-blacklist.js @@ -151,6 +151,7 @@ add("wt2html", "CSS line continuation 2", ""); add("wt2html", "Sanitizer: Closing of closed but not open table tags", "Table not started"); add("wt2html", "Sanitizer: Validating that and work, but only for Microdata", "\n\tmeta itemprop=\"hello\" content=\"world\">\n\tmeta http-equiv=\"refresh\" content=\"5\">\n\tmeta itemprop=\"hello\" http-equiv=\"refresh\" content=\"5\">\n\tlink itemprop=\"hello\" href=\"{{SERVER}}\">\n\tlink rel=\"stylesheet\" href=\"{{SERVER}}\">\n\tlink rel=\"stylesheet\" itemprop=\"hello\" href=\"{{SERVER}}\">\n"); +add("wt2html", "Sanitizer: angle brackets are invalid, even in interwiki links (T182338)", "http://www.usemod.com/cgi-bin/mb.pl?FooBar\; title=\"meatball:FooBar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?FooBar\"},\"sa\":{\"href\":\"meatball:FooBar\"},\"isIW\":true,\"dsr\":[0,20,2,2]}'>meatball:FooBar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\" title=\"meatball:Foo>Bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\"},\"sa\":{\"href\":\"meatball:Foo>Bar\"},\"isIW\":true,\"dsr\":[21,41,2,2]}'>meatball:Foo>Bar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foobar\; title=\"meatball:Foobar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foobar\"},\"sa\":{\"href\":\"meatball:Foolt;bar\"},\"isIW\":true,\"dsr\":[42,65,2,2]}'>meatball:Foobar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>bar\" title=\"meatball:Foo>bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>bar\"},\"sa\":{\"href\":\"meatball:Foogt;bar\"},\"isIW\":true,\"dsr\":[66,89,2,2]}'>meatball:Foo>bar"); add("wt2html", "Language converter glossary rules inside attributes (T119158)", "\n\n"); add("wt2html", "Inline HTML vs wiki block nesting", "Bold paragraph\n\nNew wiki paragraph"); add("wt2html", "Special page transclusion", "{{Special:Prefixindex/Xyzzyx}}"); @@ -417,6 +418,7 @@ add("html2html", "CSS line continuation 2", "\n"); add("html2html", "Parser hook: nested tags", "/tag>"); add("html2html", "Sanitizer: Validating that and work, but only for Microdata", "\n\tmeta itemprop=\"hello\" content=\"world\" />\n\tmeta http-equiv=\"refresh\" content=\"5\">\n\tmeta itemprop=\"hello\" content=\"5\" />\n\thttp://example.org\; data-parsoid='{\"targetOff\":162,\"contentOffsets\":[162,162],\"dsr\":[143,163,19,1]}'>\n\tlink rel=\"stylesheet\" href=\"http://example.org\;>\n\thttp://example.org\; data-parsoid='{\"targetOff\":235,\"contentOffsets\":[235,235],\"dsr\":[216,236,19,1]}'>\n\n\n"); +add("html2html", "Sanitizer: angle brackets are invalid, even in interwiki links (T182338)", "http://www.usemod.com/cgi-bin/mb.pl?FooBar\; title=\"meatball:FooBar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?FooBar\"},\"sa\":{\"href\":\"meatball:FooBar\"},\"isIW\":true,\"dsr\":[0,20,2,2]}'>meatball:FooBar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\" title=\"meatball:Foo>Bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>Bar\"},\"sa\":{\"href\":\"meatball:Foo>Bar\"},\"isIW\":true,\"dsr\":[21,41,2,2]}'>meatball:Foo>Bar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foobar\; title=\"meatball:Foobar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foobar\"},\"sa\":{\"href\":\"meatball:Foobar\"},\"isIW\":true,\"dsr\":[42,62,2,2]}'>meatball:Foobar\nhttp://www.usemod.com/cgi-bin/mb.pl?Foo>bar\" title=\"meatball:Foo>bar\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://www.usemod.com/cgi-bin/mb.pl?Foo>bar\"},\"sa\":{\"href\":\"meatball:Foo>bar\"},\"isIW\":true,\"dsr\":[63,83,2,2]}'>meatball:Foo>bar\n"); add("html2html", "Language converter glossary rules inside attributes (T119158)", "\n\n"); add("html2html", "HTML ordered list item with parameters oddity", " One\n"); add("html2html", "Special page transclusion", " Xyzzyx\n"); @@ -866,6 +868,7 @@ add("html2wt", "Sanitizer: Closing of open tags", "\n{|\n|}\n"); add("html2wt", "Sanitizer: Closing of open but not closed tags", "foo\n"); add("html2wt", "Sanitizer: