From: Arlo Breault Date: Wed, 26 Aug 2015 21:33:12 +0000 (-0700) Subject: Allow stop characters as quoted attribute delimiters X-Git-Tag: 1.31.0-rc.0~10179^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=174b09c1846f447aabd1276507e11963e157dbfb;p=lhc%2Fweb%2Fwiklou.git Allow stop characters as quoted attribute delimiters * Matches Parsoid in Ibdaa51f94eadc640278594a3eb5dd43356c286ea Change-Id: I51b6861d7232d857b75881966091ae1e662c13a9 --- diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index fbf3234407..3591504bc9 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -346,8 +346,8 @@ class Sanitizer { ($space*=$space* (?: # The attribute value: quoted or alone - \"([^<\"]*)\" - | '([^<']*)' + \"([^<\"]*)(?:\"|\$) + | '([^<']*)(?:'|\$) | ([a-zA-Z0-9!#$%&()*,\\-.\\/:;<>?@[\\]^_`{|}~]+) ) )?(?=$space|\$)/sx"; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f70a1b0de0..8fe8c6159a 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -6859,9 +6859,6 @@ parsoid=wt2html,wt2wt !! end - -# PHP throws away the (semi-broken) "foo" class here; Parsoid -# preserves it. !!test Parsoid: Recover better from broken table attributes !!options @@ -6872,7 +6869,7 @@ parsoid=wt2html foo |} !!html/php+tidy - +

foo

@@ -20616,7 +20613,7 @@ __TOC__

Hello[edit]

-

b">Evilbye[edit]

+

b">Evilbye[edit]

!! end @@ -23407,20 +23404,9 @@ HTML tag with broken attribute value quoting !! wikitext Foo

-!! end - -!! test -Parsoid-only: HTML tag with broken attribute value quoting -!! options -parsoid -!! wikitext -Foo

!! end @@ -23434,7 +23420,7 @@ Table with broken attribute value quoting !! html/php -
Foo +Foo
!! html/parsoid @@ -23455,9 +23441,9 @@ Table with broken attribute value quoting on consecutive lines !! html/php - -
Foo +Foo Bar +Bar
!! html/parsoid