X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FHttpStatus.php;h=72fc33386935716ec0b7afaaaf4f55de15dd9e16;hb=5120937028f768749d058aa91dde82a96de0af1c;hp=3d7dee7da1c2d921d5d291b6738bb05f776ea29f;hpb=3de7e73bd0f0ddf5d7c38fd46edfae96d1a64e40;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/HttpStatus.php b/includes/libs/HttpStatus.php index 3d7dee7da1..7e652162b2 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; } @@ -98,9 +98,10 @@ class HttpStatus { $message = self::getMessage( $code ); if ( $message === null ) { trigger_error( "Unknown HTTP status code $code", E_USER_WARNING ); - return false; + return; } + MediaWiki\HeaderCallback::warnIfHeadersSent(); if ( $version === null ) { $version = isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0' ?