Merge "Add MessagesBi.php"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderClientHtml.php
index b49a2da..5c072bf 100644 (file)
@@ -18,6 +18,7 @@
  * @file
  */
 
+use Wikimedia\WrappedString;
 use Wikimedia\WrappedStringList;
 
 /**
@@ -94,7 +95,6 @@ class ResourceLoaderClientHtml {
        /**
         * Ensure the styles of one or more modules are loaded.
         *
-        * @deprecated since 1.28
         * @param array $modules Array of module names
         */
        public function setModuleStyles( array $modules ) {
@@ -304,7 +304,10 @@ class ResourceLoaderClientHtml {
                // Inline RLQ: Load general modules
                if ( $data['general'] ) {
                        $chunks[] = ResourceLoader::makeInlineScript(
-                               Xml::encodeJsCall( 'mw.loader.load', [ $data['general'] ] ),
+                               'RLPAGEMODULES='
+                                       . ResourceLoader::encodeJsonForScript( $data['general'] )
+                                       . ';'
+                                       . 'mw.loader.load(RLPAGEMODULES);',
                                $nonce
                        );
                }
@@ -351,7 +354,7 @@ class ResourceLoaderClientHtml {
                        $startupQuery
                );
 
-               return WrappedStringList::join( "\n", $chunks );
+               return WrappedString::join( "\n", $chunks );
        }
 
        /**
@@ -369,7 +372,7 @@ class ResourceLoaderClientHtml {
                        );
                }
 
-               return WrappedStringList::join( "\n", $chunks );
+               return WrappedString::join( "\n", $chunks );
        }
 
        private function getContext( $group, $type ) {
@@ -405,7 +408,8 @@ class ResourceLoaderClientHtml {
         * @param array $modules One or more module names
         * @param string $only ResourceLoaderModule TYPE_ class constant
         * @param array $extraQuery [optional] Array with extra query parameters for the request
-        * @param string $nonce [optional] Content-Security-Policy nonce (from OutputPage::getCSPNonce)
+        * @param string|null $nonce [optional] Content-Security-Policy nonce
+        *  (from OutputPage::getCSPNonce)
         * @return string|WrappedStringList HTML
         */
        public static function makeLoad( ResourceLoaderContext $mainContext, array $modules, $only,