Followup r94349; Interwiki::getURL used `$title != null` to test if the $title arg...
authorDaniel Friesen <dantman@users.mediawiki.org>
Fri, 12 Aug 2011 14:55:25 +0000 (14:55 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Fri, 12 Aug 2011 14:55:25 +0000 (14:55 +0000)
Update the Interwiki::getURL code to use isset(), and update the comment to tell pre-1.19 supporting extensions to do the entire urlencoding and $1 substitution on their own since Interwiki::getURL was essentially buggy and broken before now.

includes/interwiki/Interwiki.php

index 1ba0f10..711fea4 100644 (file)
@@ -315,13 +315,13 @@ class Interwiki {
         *
         * @param $title String: what text to put for the article name
         * @return String: the URL
-        * @note Prior to 1.19 getURL did not urlencode the $title, if you use this
-        *       arg in an extension that supports MW earlier than 1.19 please ensure
-        *       you wfUrlencode it when installed in earlier versions of MW.
+        * @note Prior to 1.19 The getURL with an argument was broken.
+        *       If you if you use this arg in an extension that supports MW earlier
+        *       than 1.19 please wfUrlencode and substitute $1 on your own.
         */
        public function getURL( $title = null ) {
                $url = $this->mURL;
-               if( $title != null ) {
+               if( isset($title) ) {
                        $url = str_replace( "$1", wfUrlencode( $title ), $url );
                }
                return $url;