Fix parsertest: "Always escape literal '>' in output, not just after '<'"
* Fix hardcoded background color in parserTests.php
* 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.
== Languages updated ==
# Remove HTML comments
$text = Sanitizer::removeHTMLcomments( $text );
$bits = explode( '<', $text );
- $text = array_shift( $bits );
+ $text = str_replace( '>', '>', array_shift( $bits ) );
if(!$wgUseTidy) {
$tagstack = $tablestack = array();
foreach ( $bits as $x ) {
that wouldn't be valid XML however, since in XML -- has to terminate a comment
-->-->
!! result
-<p>-->
+<p>-->
</p>
!! end
!! input
<!--<!-- no, we're not going to do anything fancy here -->-->
!! result
-<p>-->
+<p>-->
</p>
!! end
# This isn't needed for XHTML conformance, but would be handy as a fallback security measure
!! test
-TODO: Always escape literal '>' in output, not just after '<'
+Always escape literal '>' in output, not just after '<'
!! input
><>
!! result