r100966 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100965‎ | r100966 | r100967 >
Date:12:17, 27 October 2011
Author:liangent
Status:ok
Tags:
Comment:
Newline to <br> replacement should take place after escaping
Modified paths:
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php
@@ -296,8 +296,8 @@
297297 }
298298
299299 if ( $format == 'text' ) {
300 - $old = htmlspecialchars( $old );
301 - $new = htmlspecialchars( $new );
 300+ $old = nl2br( htmlspecialchars( $old ) );
 301+ $new = nl2br( htmlspecialchars( $new ) );
302302 }
303303
304304 $row .= Xml::tags( 'td', array( 'class' => $oldClass ), $old );
@@ -315,8 +315,8 @@
316316 }
317317
318318 if ( $old == $new ) {
319 - $old = implode( "<br />\n", $old );
320 - $new = implode( "<br />\n", $new );
 319+ $old = implode( "\n", $old );
 320+ $new = implode( "\n", $new );
321321 return $this->getSimpleRow( $msg, $old, $new, 'text' );
322322 }
323323

Status & tagging log