Otherwise, extensions defining icon pack modules in extension.json
would need to specify "localBasePath": "../..", which is silly.
Follow-up to
a8dae2212cc5e23e181023af2ba1891078b14355.
Change-Id: If8f02867955d649c809b6b41de0f77e594b633d6
* @throws InvalidArgumentException
*/
public function __construct( $options = [], $localBasePath = null ) {
- $this->localBasePath = self::extractLocalBasePath( $options, $localBasePath );
+ $this->localBasePath = static::extractLocalBasePath( $options, $localBasePath );
$this->definition = $options;
}
return $definition;
}
+
+ public static function extractLocalBasePath( $options, $localBasePath = null ) {
+ global $IP;
+ if ( $localBasePath === null ) {
+ $localBasePath = $IP;
+ }
+ // Ignore any 'localBasePath' present in $options, this always refers to files in MediaWiki core
+ return $localBasePath;
+ }
}