HttpError: Convert line breaks in text message to <br>
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 16 Sep 2015 17:22:35 +0000 (18:22 +0100)
committerKrinkle <krinklemail@gmail.com>
Wed, 16 Sep 2015 18:28:41 +0000 (18:28 +0000)
Used by MediaWiki::tryNormaliseRedirect() for example with plain text
containing line breaks.

Change-Id: I5949046af4065c5536080212b96374466849b91a

includes/exception/HttpError.php

index b910ec6..9211bf8 100644 (file)
@@ -121,7 +121,7 @@ class HttpError extends MWException {
                if ( $this->content instanceof Message ) {
                        $contentHtml = $this->content->escaped();
                } else {
-                       $contentHtml = htmlspecialchars( $this->content );
+                       $contentHtml = nl2br( htmlspecialchars( $this->content ) );
                }
 
                return "<!DOCTYPE html>\n" .