From 3df840d216c765b2e5dd3f79c0acc8db251c9c3d Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 7 Jun 2020 12:33:40 +0200 Subject: [PATCH] Pass function name to HttpRequestFactory::create Useful for logging Replace deprecated MWHttpRequest::factory with service (since 1.32) Change-Id: I81d8d350730f0f7da5cbf0a1463aaffbc07d2fab --- extension.json | 2 +- includes/RSSParser.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extension.json b/extension.json index 481af56..0eb3ec2 100644 --- a/extension.json +++ b/extension.json @@ -16,7 +16,7 @@ ], "version": "2.25.1", "requires": { - "MediaWiki": ">= 1.31.0" + "MediaWiki": ">= 1.32.0" }, "license-name": "GPL-2.0-or-later", "url": "https://www.mediawiki.org/wiki/Extension:RSS", diff --git a/includes/RSSParser.php b/includes/RSSParser.php index f1ac24c..8711c49 100644 --- a/includes/RSSParser.php +++ b/includes/RSSParser.php @@ -294,7 +294,7 @@ class RSSParser { // we set followRedirects intentionally to true to see error messages // in cases where the maximum number of redirects is reached - $client = MWHttpRequest::factory( $url, + $client = MediaWikiServices::getInstance()->getHttpRequestFactory()->create( $url, [ 'timeout' => $wgRSSFetchTimeout, 'followRedirects' => true, @@ -302,7 +302,8 @@ class RSSParser { 'proxy' => $wgRSSProxy, 'noProxy' => $noProxy, 'userAgent' => $wgRSSUserAgent, - ] + ], + __METHOD__ ); foreach ( $headers as $header => $value ) {