X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FHttpStatus.php;h=27f872857c0d4bf0c21f0cef934f987d7de9c100;hb=b444c2a3dfa459e7e54fd822e4d04cd9882f90e2;hp=442298a60bbe6f06707977edd5e5baaea7632feb;hpb=a07ea9326e540e7b7b54685a0dff796cd9e9572f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/HttpStatus.php b/includes/libs/HttpStatus.php index 442298a60b..27f872857c 100644 --- a/includes/libs/HttpStatus.php +++ b/includes/libs/HttpStatus.php @@ -32,7 +32,7 @@ class HttpStatus { * @return string|null Message, or null if $code is not known */ public static function getMessage( $code ) { - static $statusMessage = array( + static $statusMessage = [ 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', @@ -83,7 +83,7 @@ class HttpStatus { 505 => 'HTTP Version Not Supported', 507 => 'Insufficient Storage', 511 => 'Network Authentication Required', - ); + ]; return isset( $statusMessage[$code] ) ? $statusMessage[$code] : null; } @@ -101,8 +101,12 @@ class HttpStatus { return false; } + MediaWiki\HeaderCallback::warnIfHeadersSent(); if ( $version === null ) { - $version = isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0' ? '1.0' : '1.1'; + $version = isset( $_SERVER['SERVER_PROTOCOL'] ) && + $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0' ? + '1.0' : + '1.1'; } header( "HTTP/$version $code $message" );