diff --git a/includes/Engines/LuaCommon/SiteLibrary.php b/includes/Engines/LuaCommon/SiteLibrary.php index bb5f7ebb..6339f58e 100644 --- a/includes/Engines/LuaCommon/SiteLibrary.php +++ b/includes/Engines/LuaCommon/SiteLibrary.php @@ -214,16 +214,20 @@ class SiteLibrary extends LibraryBase { // Not expensive because we can have a max of three cache misses in the // entire page parse. $interwikiMap = []; - $lookup = MediaWikiServices::getInstance()->getInterwikiLookup(); + + $services = MediaWikiServices::getInstance(); + $lookup = $services->getInterwikiLookup(); + $config = $services->getMainConfig(); + $urlUtils = $services->getUrlUtils(); + $prefixes = $lookup->getAllPrefixes( $local ); - $config = MediaWikiServices::getInstance()->getMainConfig(); $localInterwikis = $config->get( MainConfigNames::LocalInterwikis ); $extraInterlanguageLinkPrefixes = $config->get( MainConfigNames::ExtraInterlanguageLinkPrefixes ); foreach ( $prefixes as $row ) { $prefix = $row['iw_prefix']; $val = [ 'prefix' => $prefix, - 'url' => wfGetUrlUtils()->expand( $row['iw_url'], PROTO_RELATIVE ) ?? false, + 'url' => $urlUtils->expand( $row['iw_url'], PROTO_RELATIVE ) ?? false, 'isProtocolRelative' => substr( $row['iw_url'], 0, 2 ) === '//', 'isLocal' => isset( $row['iw_local'] ) && $row['iw_local'] == '1', 'isTranscludable' => isset( $row['iw_trans'] ) && $row['iw_trans'] == '1',