aboutsummaryrefslogtreecommitdiffstats
path: root/includes/WikiMap
diff options
context:
space:
mode:
authorJames D. Forrester <jforrester@wikimedia.org>2024-08-28 10:49:33 -0400
committerTimo Tijhof <krinkle@fastmail.com>2024-09-10 16:50:02 -0700
commit2b11d61577dd1d850fd3168afc19e684ac89c2b5 (patch)
tree68187dec7b61e53ca37c2e2adf456cd1cca9c054 /includes/WikiMap
parent09121089f46c9ae9c78cee02209c4199f27e3ef8 (diff)
downloadmediawikicore-2b11d61577dd1d850fd3168afc19e684ac89c2b5.tar.gz
mediawikicore-2b11d61577dd1d850fd3168afc19e684ac89c2b5.zip
Migrate all uses of deprecated URL global functions to use wfGetUrlUtils()
wfGetUrlUtils() is also deprecated, but less so, so we can do this first and then properly replace the individual uses with dependency injection in local pieces of work. Also: * Switching Parser::getExternalLinkRel to UrlUtils::matchesDomainList exposed a type error in media.txt where $wgNoFollowDomainExceptions was set to a string (which is invalid) instead of an array. Bug: T319340 Change-Id: Icb512d7241954ee155b64c57f3782b86acfd9a4c
Diffstat (limited to 'includes/WikiMap')
-rw-r--r--includes/WikiMap/WikiMap.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/WikiMap/WikiMap.php b/includes/WikiMap/WikiMap.php
index ae24197261e5..c9fb22d58ec2 100644
--- a/includes/WikiMap/WikiMap.php
+++ b/includes/WikiMap/WikiMap.php
@@ -95,8 +95,8 @@ class WikiMap {
return null;
}
- $urlParts = wfParseUrl( $site->getPageUrl() );
- if ( $urlParts === false || !isset( $urlParts['path'] ) || !isset( $urlParts['host'] ) ) {
+ $urlParts = wfGetUrlUtils()->parse( $site->getPageUrl() );
+ if ( $urlParts === null || !isset( $urlParts['path'] ) || !isset( $urlParts['host'] ) ) {
// We can't create a meaningful WikiReference without URLs
return null;
}
@@ -208,14 +208,14 @@ class WikiMap {
$wikiId = self::getCurrentWikiId();
$infoMap[$wikiId] = [
'url' => $wgCanonicalServer,
- 'parts' => wfParseUrl( $wgCanonicalServer )
+ 'parts' => wfGetUrlUtils()->parse( $wgCanonicalServer )
];
foreach ( $wgLocalDatabases as $wikiId ) {
$wikiReference = self::getWiki( $wikiId );
if ( $wikiReference ) {
$url = $wikiReference->getCanonicalServer();
- $infoMap[$wikiId] = [ 'url' => $url, 'parts' => wfParseUrl( $url ) ];
+ $infoMap[$wikiId] = [ 'url' => $url, 'parts' => wfGetUrlUtils()->parse( $url ) ];
}
}
@@ -238,8 +238,8 @@ class WikiMap {
return self::getCurrentWikiId();
}
- $urlPartsCheck = wfParseUrl( $url );
- if ( $urlPartsCheck === false ) {
+ $urlPartsCheck = wfGetUrlUtils()->parse( $url );
+ if ( $urlPartsCheck === null ) {
return false;
}