From 48c4ccdde140ef7f71b139e0caeb20440b9a0d3f Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Thu, 21 Nov 2024 11:01:11 -0700 Subject: [PATCH] Fix PageImages compatibility with MediaWiki 1.43+ (#136) --- .../services/Parser/MediaWikiParserService.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/services/Parser/MediaWikiParserService.php b/includes/services/Parser/MediaWikiParserService.php index 3b5e4d7..6d239b7 100644 --- a/includes/services/Parser/MediaWikiParserService.php +++ b/includes/services/Parser/MediaWikiParserService.php @@ -107,7 +107,19 @@ class MediaWikiParserService implements ExternalParser { if ( method_exists( ParserFileProcessingHookHandlers::class, 'onParserModifyImageHTML' ) ) { - if ( version_compare( MW_VERSION, '1.42', '>=' ) ) { + if ( version_compare( MW_VERSION, '1.43', '>=' ) ) { + // @phan-suppress-next-line PhanParamTooMany + $handler = new ParserFileProcessingHookHandlers( + $services->getMainConfig(), + $repoGroup, + $services->getMainWANObjectCache(), + $services->getHttpRequestFactory(), + // @phan-suppress-next-line PhanUndeclaredMethod + $services->getConnectionProvider(), + $services->getTitleFactory(), + $services->getLinksMigration() + ); + } elseif ( version_compare( MW_VERSION, '1.42', '>=' ) ) { // @phan-suppress-next-line PhanParamTooMany $handler = new ParserFileProcessingHookHandlers( $repoGroup,