X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoader.php;h=c11fe5b6187b16cf663f46cd8beef69a1f11b49c;hb=41f4a25131c960186a979ade8b67b08ad3fee0b3;hp=d144987b605baaa2d8520c8c1f0ad438cbe75817;hpb=72514f50d55bd5b8107fdf1925ae012d6dae42a4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index d144987b60..c11fe5b618 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -563,7 +563,8 @@ class ResourceLoader implements LoggerAwareInterface { } /** - * Return whether the definition of a module corresponds to a simple ResourceLoaderFileModule. + * Return whether the definition of a module corresponds to a simple ResourceLoaderFileModule + * or one of its subclasses. * * @param string $name Module name * @return bool @@ -573,7 +574,14 @@ class ResourceLoader implements LoggerAwareInterface { return false; } $info = $this->moduleInfos[$name]; - if ( isset( $info['object'] ) || isset( $info['class'] ) ) { + if ( isset( $info['object'] ) ) { + return false; + } + if ( + isset( $info['class'] ) && + $info['class'] !== 'ResourceLoaderFileModule' && + !is_subclass_of( $info['class'], 'ResourceLoaderFileModule' ) + ) { return false; } return true; @@ -1165,7 +1173,7 @@ MESSAGE; * @param array $templates Keys are name of templates and values are the source of * the template. * @throws MWException - * @return string + * @return string JavaScript code */ protected static function makeLoaderImplementScript( $name, $scripts, $styles, $messages, $templates @@ -1195,7 +1203,7 @@ MESSAGE; * * @param mixed $messages Either an associative array mapping message key to value, or a * JSON-encoded message blob containing the same data, wrapped in an XmlJsCode object. - * @return string + * @return string JavaScript code */ public static function makeMessageSetScript( $messages ) { return Xml::encodeJsCall( @@ -1251,7 +1259,7 @@ MESSAGE; * * @param string $name * @param string $state - * @return string + * @return string JavaScript code */ public static function makeLoaderStateScript( $name, $state = null ) { if ( is_array( $name ) ) { @@ -1281,7 +1289,7 @@ MESSAGE; * @param string $group Group which the module is in. * @param string $source Source of the module, or 'local' if not foreign. * @param string $script JavaScript code - * @return string + * @return string JavaScript code */ public static function makeCustomLoaderScript( $name, $version, $dependencies, $group, $source, $script @@ -1353,7 +1361,7 @@ MESSAGE; * @param string $group Group which the module is in * @param string $source Source of the module, or 'local' if not foreign * @param string $skip Script body of the skip function - * @return string + * @return string JavaScript code */ public static function makeLoaderRegisterScript( $name, $version = null, $dependencies = null, $group = null, $source = null, $skip = null @@ -1407,7 +1415,7 @@ MESSAGE; * * @param string $id Source ID * @param string $loadUrl load.php url - * @return string + * @return string JavaScript code */ public static function makeLoaderSourcesScript( $id, $loadUrl = null ) { if ( is_array( $id ) ) { @@ -1431,7 +1439,7 @@ MESSAGE; * * @deprecated since 1.25; use makeInlineScript instead * @param string $script JavaScript code - * @return string + * @return string JavaScript code */ public static function makeLoaderConditionalScript( $script ) { return '(window.RLQ=window.RLQ||[]).push(function(){' . @@ -1461,7 +1469,7 @@ MESSAGE; * the given value. * * @param array $configuration List of configuration values keyed by variable name - * @return string + * @return string JavaScript code */ public static function makeConfigSetScript( array $configuration ) { return Xml::encodeJsCall(