Fix not-loaded DbPageLanguage when Title::getPageLanguage() get's called
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index 74ee6ab..51a6225 100644 (file)
@@ -618,11 +618,8 @@ class ResourceLoader implements LoggerAwareInterface {
                if ( !$modules ) {
                        return '';
                }
-               // Support: PHP 5.3 ("$this" for anonymous functions was added in PHP 5.4.0)
-               // http://php.net/functions.anonymous
-               $rl = $this;
-               $hashes = array_map( function ( $module ) use ( $rl, $context ) {
-                       return $rl->getModule( $module )->getVersionHash( $context );
+               $hashes = array_map( function ( $module ) use ( $context ) {
+                       return $this->getModule( $module )->getVersionHash( $context );
                }, $modules );
                return self::makeHash( implode( $hashes ) );
        }
@@ -1365,7 +1362,7 @@ MESSAGE;
         * @return string
         */
        public static function makeLoaderConditionalScript( $script ) {
-               return "window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n" .
+               return "(window.RLQ = window.RLQ || []).push(function () {\n" .
                        trim( $script ) . "\n} );";
        }
 
@@ -1382,7 +1379,7 @@ MESSAGE;
                $js = self::makeLoaderConditionalScript( $script );
                return new WrappedString(
                        Html::inlineScript( $js ),
-                       "<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n",
+                       "<script>(window.RLQ = window.RLQ || []).push(function () {\n",
                        "\n} );</script>"
                );
        }