From: Kunal Mehta Date: Sun, 13 Dec 2015 03:45:43 +0000 (-0800) Subject: ApiBase::getModuleSourceInfo(): Use $wgExtensionDirectory X-Git-Tag: 1.31.0-rc.0~6024^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=9f84ca772dd1a40c15f86553c270cb94133493a7;p=lhc%2Fweb%2Fwiklou.git ApiBase::getModuleSourceInfo(): Use $wgExtensionDirectory This function takes the class file path, and iterates up through its parent directories until it hits either a registered extension, or $IP (for core) or $IP/extensions (for an unknown extension). This change adds $wgExtensionDirectory as another iteration stopper, so that unregistered extensions in $wgExtensionDirectory will not cause iteration back up to the filesystem root, or to $IP if $wgExtensionDirectory is a child of $IP other than $IP/extensions. Change-Id: I06553591b0b6156e945aad5176479eb71517e77d --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b45eacb693..4a1a520f12 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -2458,6 +2458,7 @@ abstract class ApiBase extends ContextSource { // Build map of extension directories to extension info if ( self::$extensionInfo === null ) { + $extDir = $this->getConfig()->get( 'ExtensionDirectory' ); self::$extensionInfo = [ realpath( __DIR__ ) ?: __DIR__ => [ 'path' => $IP, @@ -2465,6 +2466,7 @@ abstract class ApiBase extends ContextSource { 'license-name' => 'GPL-2.0+', ], realpath( "$IP/extensions" ) ?: "$IP/extensions" => null, + realpath( $extDir ) ?: $extDir => null, ]; $keep = [ 'path' => null,