X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=5ad33fad0f18178654ca829dcb75be9fad5ca0b8;hb=524d92b61f2a951200b00326cfac6b25a830acb6;hp=aa282a793f769022df95db4bcd35b093cd11465c;hpb=ca3ac3dfb89d2e801a65565dd8186ff250cde3df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index aa282a793f..5ad33fad0f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1412,7 +1412,8 @@ class OutputPage extends ContextSource { if ( $overrideBaseUrl ) { $helpUrl = $to; } else { - $helpUrl = "//www.mediawiki.org/wiki/Special:MyLanguage/$to"; + $toUrlencoded = wfUrlencode( str_replace( ' ', '_', $to ) ); + $helpUrl = "//www.mediawiki.org/wiki/Special:MyLanguage/$toUrlencoded"; } $link = Html::rawElement( 'a', @@ -2673,10 +2674,12 @@ class OutputPage extends ContextSource { $ret .= $item . "\n"; } + $ret .= $this->getInlineHeadScript(); + // No newline after buildCssLinks since makeResourceLoaderLink did that already $ret .= $this->buildCssLinks(); - $ret .= $this->getHeadScripts() . "\n"; + $ret .= $this->getHeadScripts(); foreach ( $this->mHeadItems as $item ) { $ret .= $item . "\n"; @@ -2853,10 +2856,8 @@ class OutputPage extends ContextSource { $resourceLoader->makeModuleResponse( $context, $grpModules ) ); } else { - $links['html'] .= Html::inlineScript( - ResourceLoader::makeLoaderConditionalScript( - $resourceLoader->makeModuleResponse( $context, $grpModules ) - ) + $links['html'] .= ResourceLoader::makeInlineScript( + $resourceLoader->makeModuleResponse( $context, $grpModules ) ); } $links['html'] .= "\n"; @@ -2895,22 +2896,18 @@ class OutputPage extends ContextSource { if ( $only === ResourceLoaderModule::TYPE_STYLES ) { $link = Html::linkedStyle( $url ); } elseif ( $loadCall ) { - $link = Html::inlineScript( - ResourceLoader::makeLoaderConditionalScript( - Xml::encodeJsCall( 'mw.loader.load', array( $url, 'text/javascript', true ) ) - ) + $link = ResourceLoader::makeInlineScript( + Xml::encodeJsCall( 'mw.loader.load', array( $url, 'text/javascript', true ) ) ); } else { $link = Html::linkedScript( $url ); - if ( $context->getOnly() === 'scripts' && !$context->getRaw() && !$isRaw ) { - // Wrap only=script requests in a conditional as browsers not supported - // by the startup module would unconditionally execute this module. - // Otherwise users will get "ReferenceError: mw is undefined" or - // "jQuery is undefined" from e.g. a "site" module. - $link = Html::inlineScript( - ResourceLoader::makeLoaderConditionalScript( - Xml::encodeJsCall( 'document.write', array( $link ) ) - ) + if ( !$context->getRaw() && !$isRaw ) { + // Wrap only=script / only=combined requests in a conditional as + // browsers not supported by the startup module would unconditionally + // execute this module. Otherwise users will get "ReferenceError: mw is + // undefined" or "jQuery is undefined" from e.g. a "site" module. + $link = ResourceLoader::makeInlineScript( + Xml::encodeJsCall( 'document.write', array( $link ) ) ); } @@ -2954,16 +2951,44 @@ class OutputPage extends ContextSource { } if ( count( $states ) ) { - $html = Html::inlineScript( - ResourceLoader::makeLoaderConditionalScript( - ResourceLoader::makeLoaderStateScript( $states ) - ) + $html = ResourceLoader::makeInlineScript( + ResourceLoader::makeLoaderStateScript( $states ) ) . "\n" . $html; } return $html; } + /** + * Get