From: Aaron Schulz Date: Thu, 3 Nov 2016 04:56:00 +0000 (-0700) Subject: Improve getUrlDomainDistance() return values X-Git-Tag: 1.31.0-rc.0~4966^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=7d4b206aa989482c5e5b7da8a94aeec3bdcc38b8;p=lhc%2Fweb%2Fwiklou.git Improve getUrlDomainDistance() return values This change is just cosmetic given the caller it has. Change-Id: I591f92e56d9f5574d032dda380bc03b491b10738 --- 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'; } /**