From 969b1f266bc3f10a85a28eec32e80a65969b2ea6 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Fri, 15 May 2020 12:09:24 -0700 Subject: [PATCH] Replace use of old global with MW_VERSION constant This repo already requires MW 1.35+ so compatibility isn't a concern. Change-Id: I3be0e1afe7f9acb56e7070d9d81424b7461a1603 --- includes/ApiParsoidTrait.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/ApiParsoidTrait.php b/includes/ApiParsoidTrait.php index 3ee94e2ca2..0d5f58004b 100644 --- a/includes/ApiParsoidTrait.php +++ b/includes/ApiParsoidTrait.php @@ -105,7 +105,6 @@ trait ApiParsoidTrait { * @return array The RESTbase server's response, 'code', 'reason', 'headers' and 'body' */ protected function requestRestbase( Title $title, $method, $path, $params, $reqheaders = [] ) { - global $wgVersion; $request = [ 'method' => $method, 'url' => '/restbase/local/v1/' . $path @@ -120,8 +119,8 @@ trait ApiParsoidTrait { 'Accept' => 'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.0.0"', 'Accept-Language' => self::getPageLanguage( $title )->getCode(), - 'User-Agent' => 'VisualEditor-MediaWiki/' . $wgVersion, - 'Api-User-Agent' => 'VisualEditor-MediaWiki/' . $wgVersion, + 'User-Agent' => 'VisualEditor-MediaWiki/' . MW_VERSION, + 'Api-User-Agent' => 'VisualEditor-MediaWiki/' . MW_VERSION, ]; // $reqheaders take precedence over $defaultReqHeaders $request['headers'] = $reqheaders + $defaultReqHeaders;