From 02ff859a87333e41c4e4a9d8425507faec9c2ae9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 6 Jun 2006 23:50:16 +0000 Subject: [PATCH] * (bug 3837) Leave
as is instead of doing an unsafe text replacement to
.
is perfectly valid in the target doctype (XHTML 1.0 Transitional), while the replacement didn't catch all cases and could even result in invalid output from valid input. --- RELEASE-NOTES | 4 ++++ includes/Parser.php | 5 ++--- maintenance/parserTests.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 838a4cbd9b..488aaa66c4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -446,6 +446,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 3202) Attributes now allowed on
 tags
 * Sanitizer::validateTagAttributes now available to discard illegal/unsafe
   attribute values from an array.
+* (bug 3837) Leave 
as is instead of doing an unsafe text replacement + to
.
is perfectly valid in the target doctype + (XHTML 1.0 Transitional), while the replacement didn't catch all cases and + could even result in invalid output from valid input. == Compatibility == diff --git a/includes/Parser.php b/includes/Parser.php index 52df980a6c..61de1bf1a1 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -248,7 +248,6 @@ class Parser '/(.) (?=\\?|:|;|!|\\302\\273)/' => '\\1 \\2', # french spaces, Guillemet-right '/(\\302\\253) /' => '\\1 ', - '/
(.*)<\\/center *>/i' => '
\\1
', ); $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text ); @@ -1891,10 +1890,10 @@ class Parser wfProfileIn( "$fname-paragraph" ); # No prefix (not in list)--go to paragraph mode // XXX: use a stack for nestable elements like span, table and div - $openmatch = preg_match('/(mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol)/iS', $t ); + 'mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/center)/iS', $t ); if ( $openmatch or $closematch ) { $paragraphStack = false; # TODO bug 5718: paragraph closed diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index a6a8aec8c5..ceaf0f5ee3 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -3957,7 +3957,7 @@ Self closed html pairs (bug 5487)
Centered text
In div text
!! result -
<font id="bug" />Centered text
+
<font id="bug" />Centered text
<font id="bug2" />In div text
!! end -- 2.20.1