X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWebRequest.php;h=6593e49d8a219aa7d3250617778ed836f75b416c;hb=0af17b526fffa06af403163c4b758d1da2e9441e;hp=7da092f5dc0fd9631602d03c86aa4ac8fe050a8f;hpb=3074a4521a18e78e52ba44cc7c185bac7af4a866;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 7da092f5dc..6593e49d8a 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -275,8 +275,18 @@ class WebRequest { public static function getRequestId() { // This method is called from various error handlers and should be kept simple. - if ( !self::$reqId ) { - self::$reqId = $_SERVER['UNIQUE_ID'] ?? wfRandomString( 24 ); + if ( self::$reqId ) { + return self::$reqId; + } + + global $wgAllowExternalReqID; + + self::$reqId = $_SERVER['UNIQUE_ID'] ?? wfRandomString( 24 ); + if ( $wgAllowExternalReqID ) { + $id = RequestContext::getMain()->getRequest()->getHeader( 'X-Request-Id' ); + if ( $id ) { + self::$reqId = $id; + } } return self::$reqId; @@ -1130,7 +1140,7 @@ HTML; /** * Parse the Accept-Language header sent by the client into an array * - * @return array Array( languageCode => q-value ) sorted by q-value in + * @return array [ languageCode => q-value ] sorted by q-value in * descending order then appearing time in the header in ascending order. * May contain the "language" '*', which applies to languages other than those explicitly listed. * This is aligned with rfc2616 section 14.4