Fix PageImages compatibility with MediaWiki 1.40 (#102)

This commit is contained in:
CosmicAlpha 2023-07-01 11:44:34 -06:00 committed by GitHub
parent 2d13828e2c
commit 98d4e900af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,9 @@ class MediaWikiParserService implements ExternalParser {
* @param Title $title
*/
public function addImage( $title ) {
$repoGroup = MediaWikiServices::getInstance()->getRepoGroup();
$services = MediaWikiServices::getInstance();
$repoGroup = $services->getRepoGroup();
$file = $repoGroup->findFile( $title );
$tmstmp = $file ? $file->getTimestamp() : null;
@ -96,7 +98,12 @@ class MediaWikiParserService implements ExternalParser {
if ( method_exists(
ParserFileProcessingHookHandlers::class, 'onParserModifyImageHTML'
) ) {
$handler = new ParserFileProcessingHookHandlers();
// @phan-suppress-next-line PhanParamTooMany
$handler = new ParserFileProcessingHookHandlers(
$repoGroup,
$services->getMainWANObjectCache(),
$services->getHttpRequestFactory()
);
$params = [];
$html = '';