Index: trunk/phase3/includes/interwiki/Interwiki.php |
— | — | @@ -315,11 +315,14 @@ |
316 | 316 | * |
317 | 317 | * @param $title String: what text to put for the article name |
318 | 318 | * @return String: the URL |
| 319 | + * @note Prior to 1.19 getURL did not urlencode the $title, if you use this |
| 320 | + * arg in an extension that supports MW earlier than 1.19 please ensure |
| 321 | + * you wfUrlencode it when installed in earlier versions of MW. |
319 | 322 | */ |
320 | 323 | public function getURL( $title = null ) { |
321 | 324 | $url = $this->mURL; |
322 | 325 | if( $title != null ) { |
323 | | - $url = str_replace( "$1", $title, $url ); |
| 326 | + $url = str_replace( "$1", wfUrlencode( $title ), $url ); |
324 | 327 | } |
325 | 328 | return $url; |
326 | 329 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -851,15 +851,13 @@ |
852 | 852 | $url = $wgServer . $url; |
853 | 853 | } |
854 | 854 | } else { |
855 | | - $baseUrl = $interwiki->getURL(); |
856 | | - |
857 | | - $namespace = wfUrlencode( $this->getNsText() ); |
| 855 | + $namespace = $this->getNsText(); |
858 | 856 | if ( $namespace != '' ) { |
859 | 857 | # Can this actually happen? Interwikis shouldn't be parsed. |
860 | 858 | # Yes! It can in interwiki transclusion. But... it probably shouldn't. |
861 | 859 | $namespace .= ':'; |
862 | 860 | } |
863 | | - $url = str_replace( '$1', $namespace . $this->mUrlform, $baseUrl ); |
| 861 | + $url = $interwiki->getURL( $namespace . $this->getDBkey() ); |
864 | 862 | $url = wfAppendQuery( $url, $query ); |
865 | 863 | } |
866 | 864 | |