Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -3957,7 +3957,7 @@ |
3958 | 3958 | <center><font id="bug" />Centered text</center> |
3959 | 3959 | <div><font id="bug2" />In div text</div> |
3960 | 3960 | !! result |
3961 | | -<div class="center"><font id="bug" />Centered text</div> |
| 3961 | +<center><font id="bug" />Centered text</center> |
3962 | 3962 | <div><font id="bug2" />In div text</div> |
3963 | 3963 | |
3964 | 3964 | !! end |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -248,7 +248,6 @@ |
249 | 249 | '/(.) (?=\\?|:|;|!|\\302\\273)/' => '\\1 \\2', |
250 | 250 | # french spaces, Guillemet-right |
251 | 251 | '/(\\302\\253) /' => '\\1 ', |
252 | | - '/<center *>(.*)<\\/center *>/i' => '<div class="center">\\1</div>', |
253 | 252 | ); |
254 | 253 | $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text ); |
255 | 254 | |
— | — | @@ -1891,10 +1890,10 @@ |
1892 | 1891 | wfProfileIn( "$fname-paragraph" ); |
1893 | 1892 | # No prefix (not in list)--go to paragraph mode |
1894 | 1893 | // XXX: use a stack for nestable elements like span, table and div |
1895 | | - $openmatch = preg_match('/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<\\/tr|<\\/td|<\\/th)/iS', $t ); |
| 1894 | + $openmatch = preg_match('/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<center|<\\/tr|<\\/td|<\\/th)/iS', $t ); |
1896 | 1895 | $closematch = preg_match( |
1897 | 1896 | '/(<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'. |
1898 | | - '<td|<th|<div|<\\/div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol)/iS', $t ); |
| 1897 | + '<td|<th|<div|<\\/div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/center)/iS', $t ); |
1899 | 1898 | if ( $openmatch or $closematch ) { |
1900 | 1899 | $paragraphStack = false; |
1901 | 1900 | # TODO bug 5718: paragraph closed |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -446,6 +446,10 @@ |
447 | 447 | * (bug 3202) Attributes now allowed on <pre> tags |
448 | 448 | * Sanitizer::validateTagAttributes now available to discard illegal/unsafe |
449 | 449 | attribute values from an array. |
| 450 | +* (bug 3837) Leave <center> as is instead of doing an unsafe text replacement |
| 451 | + to <div class="center">. <center> is perfectly valid in the target doctype |
| 452 | + (XHTML 1.0 Transitional), while the replacement didn't catch all cases and |
| 453 | + could even result in invalid output from valid input. |
450 | 454 | |
451 | 455 | |
452 | 456 | == Compatibility == |