Ignore self closing on closing tags ( '</div />' now gives '</div>')
authorAntoine Musso <hashar@users.mediawiki.org>
Wed, 17 Jan 2007 22:06:32 +0000 (22:06 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Wed, 17 Jan 2007 22:06:32 +0000 (22:06 +0000)
Fix parsertest "Don't fall for the self-closing div"

RELEASE-NOTES
includes/Sanitizer.php

index a7a481e..738606c 100644 (file)
@@ -116,6 +116,7 @@ lighter making things easier to read.
 * parserTests.php : removed the 'light' option for --color argument, replacing
   it with a new global switch : $wgCommandLineDarkBg
 * Sanitizer now correctly escapes lonely '>' occuring before the first wikitag.
+* Ignore self closing on closing tags ( '</div />' now gives '</div>') 
 
 == Languages updated ==
 
index ebe9d5a..73d723e 100644 (file)
@@ -476,7 +476,7 @@ class Sanitizer {
                                        }
                                        if ( ! $badtag ) {
                                                $rest = str_replace( '>', '&gt;', $rest );
-                                               $close = ( $brace == '/>' ) ? ' /' : '';
+                                               $close = ( $brace == '/>' && !$slash ) ? ' /' : '';
                                                $text .= "<$slash$t$newparams$close>$rest";
                                                continue;
                                        }