From 7d4b206aa989482c5e5b7da8a94aeec3bdcc38b8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 2 Nov 2016 21:56:00 -0700 Subject: [PATCH] Improve getUrlDomainDistance() return values This change is just cosmetic given the caller it has. Change-Id: I591f92e56d9f5574d032dda380bc03b491b10738 --- includes/MediaWiki.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index f21128e59e..f7e57fc94c 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -676,14 +676,14 @@ class MediaWiki { /** * @param string $url * @param IContextSource $context - * @return string|bool Either "local" or "remote" if in the farm, false otherwise + * @return string Either "local", "remote" if in the farm, "external" otherwise */ private static function getUrlDomainDistance( $url, IContextSource $context ) { static $relevantKeys = [ 'host' => true, 'port' => true ]; $infoCandidate = wfParseUrl( $url ); if ( $infoCandidate === false ) { - return false; + return 'external'; } $infoCandidate = array_intersect_key( $infoCandidate, $relevantKeys ); @@ -705,7 +705,7 @@ class MediaWiki { } } - return false; + return 'external'; } /** -- 2.20.1