Avoid use of deprecated wfGetUrlUtils

Change-Id: Ia36e0cf4a390f32fad7da55a503ac15afa85317a
This commit is contained in:
Ebrahim Byagowi 2024-09-08 09:46:58 +03:30
parent 484338c20d
commit 27136f2afa

View file

@ -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',