Merge "Use underscores in help links"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 12 Mar 2015 14:56:31 +0000 (14:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 12 Mar 2015 14:56:31 +0000 (14:56 +0000)
1  2 
includes/OutputPage.php

diff --combined includes/OutputPage.php
@@@ -1412,7 -1412,8 +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',
                                                );
                                        } 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.
 +                                              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 = Html::inlineScript(
                                                                ResourceLoader::makeLoaderConditionalScript(
                                                                        Xml::encodeJsCall( 'document.write', array( $link ) )