Use underscores in help links
authorumherirrender <umherirrender_de.wp@web.de>
Tue, 10 Mar 2015 18:26:39 +0000 (19:26 +0100)
committerNikerabbit <niklas.laxstrom@gmail.com>
Thu, 12 Mar 2015 14:43:22 +0000 (14:43 +0000)
Replace spaces by underscore to build correct links to wiki pages. IE11
will show %20 for spaces. Also use urlencode to make the url safe.

Follow-Up: I2934b1708a0d207dcf3d940264f140613646f203
Change-Id: I5ef08441406e96aa9749476af0a81fc11fa4e4d6

includes/OutputPage.php

index aa282a7..278b4d1 100644 (file)
@@ -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',