Fix PageImages compatibility with MediaWiki 1.43+ (#136)

This commit is contained in:
CosmicAlpha 2024-11-21 11:01:11 -07:00 committed by GitHub
parent b0568a947a
commit 48c4ccdde1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,7 +107,19 @@ class MediaWikiParserService implements ExternalParser {
if ( method_exists( if ( method_exists(
ParserFileProcessingHookHandlers::class, 'onParserModifyImageHTML' 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 // @phan-suppress-next-line PhanParamTooMany
$handler = new ParserFileProcessingHookHandlers( $handler = new ParserFileProcessingHookHandlers(
$repoGroup, $repoGroup,