Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / exception / HttpError.php
index d3ee9b9..48bc3bd 100644 (file)
@@ -74,9 +74,7 @@ class HttpError extends MWException {
        public function report() {
                $this->doLog();
 
-               $httpMessage = HttpStatus::getMessage( $this->httpCode );
-
-               header( "Status: {$this->httpCode} {$httpMessage}", true, $this->httpCode );
+               HttpStatus::header( $this->httpCode );
                header( 'Content-type: text/html; charset=utf-8' );
 
                print $this->getHTML();
@@ -90,11 +88,11 @@ class HttpError extends MWException {
                        $content = $content->text();
                }
 
-               $context = array(
+               $context = [
                        'file' => $this->getFile(),
                        'line' => $this->getLine(),
                        'http_code' => $this->httpCode,
-               );
+               ];
 
                $logMsg = "$content ({http_code}) from {file}:{line}";
 
@@ -123,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" .