MediaWiki.php: Make getUrlDomainDistance() actually static
authorRoan Kattouw <roan.kattouw@gmail.com>
Fri, 14 Oct 2016 21:15:46 +0000 (14:15 -0700)
committerCatrope <roan@wikimedia.org>
Fri, 14 Oct 2016 21:17:43 +0000 (21:17 +0000)
It's only called once, and that call is static. It also doesn't use $this.

[error] /w/index.php?title=New_new_page&action=purge
ErrorException from line 610 of /vagrant/mediawiki/includes/MediaWiki.php: PHP Strict Standards: Non-static method MediaWiki::getUrlDomainDistance() should not be called statically

Change-Id: Ice66937a32193720c52df39bcea90659a8d9f653

includes/MediaWiki.php

index 218337a..f21128e 100644 (file)
@@ -678,7 +678,7 @@ class MediaWiki {
         * @param IContextSource $context
         * @return string|bool Either "local" or "remote" if in the farm, false otherwise
         */
-       private function getUrlDomainDistance( $url, IContextSource $context ) {
+       private static function getUrlDomainDistance( $url, IContextSource $context ) {
                static $relevantKeys = [ 'host' => true, 'port' => true ];
 
                $infoCandidate = wfParseUrl( $url );