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
This commit is contained in:
James D. Forrester 2020-05-15 12:09:24 -07:00
parent 0528f806fa
commit 969b1f266b

View file

@ -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;