diff --git a/BugzillaQuery.class.php b/BugzillaQuery.class.php index 7e3094b..d348661 100644 --- a/BugzillaQuery.class.php +++ b/BugzillaQuery.class.php @@ -3,6 +3,8 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +use MediaWiki\MediaWikiServices; + // Factory class class BugzillaQuery { @@ -276,7 +278,8 @@ public function _fetch_by_options() { // Add the requested query options to the request - $ua = MWHttpRequest::factory($this->url . '?' + $ua = MediaWikiServices::getInstance()->getHttpRequestFactory() + ->create($this->url . '?' . $this->_build_querystring($this->options), [ 'method' => 'GET', @@ -353,7 +356,8 @@ protected function getJsonData($method, $params): bool $query = json_encode($params, true); $url = $this->url . "?method=$method¶ms=[" . urlencode($query) . "]"; - $req = MWHttpRequest::factory($url, array( + $req = MediaWikiServices::getInstance()->getHttpRequestFactory() + ->create($url, array( 'sslVerifyHost' => false, 'sslVerifyCert' => false ) @@ -412,7 +416,8 @@ public function _fetch_by_options() X; - $ua = MWHttpRequest::factory($this->url, [ + $ua = MediaWikiServices::getInstance()->getHttpRequestFactory() + ->create($this->url, [ 'method' => 'POST', 'follow_redirects' => true, // TODO: Not sure if I should do this