* (bug 4571) Partial fix hack for {{fulllurl:}} in action=render
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 12 Jan 2006 10:06:54 +0000 (10:06 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 12 Jan 2006 10:06:54 +0000 (10:06 +0000)
Quick hack to do the same check in getFullUrl() that happens in getLocalUrl()
and if it matches *don't* add a duplicate URL prefix.
However anything is still broken that expects it, such as {{localurl:}} and it feels generally hacky.
Also switched from getText() which does expensive encoding checks to getVal()

RELEASE-NOTES
includes/Title.php

index 6440a95..d367ab0 100644 (file)
@@ -465,6 +465,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 4104) Added OutputPageBeforeHTML hook for tweaking primary wiki output
   HTML on final output (cached or not)
 * Avoid PHP notice on command-line scripts if empty argument is passed ('')
+* (bug 4571) Partial fix hack for {{fulllurl:}} in action=render
 
 
 === Caveats ===
index 0565ee2..33d7ef3 100644 (file)
@@ -665,10 +665,16 @@ class Title {
         * @access public
         */
        function getFullURL( $query = '' ) {
-               global $wgContLang, $wgServer;
+               global $wgContLang, $wgServer, $wgRequest;
 
                if ( '' == $this->mInterwiki ) {
-                       $url = $wgServer . $this->getLocalUrl( $query );
+                       $url = $this->getLocalUrl( $query );
+
+                       // Ugly quick hack to avoid duplicate prefixes (bug 4571 etc)
+                       // Correct fix would be to move the prepending elsewhere.
+                       if ($wgRequest->getVal('action') != 'render') {
+                               $url = $wgServer . $url;
+                       }
                } else {
                        $baseUrl = $this->getInterwikiLink( $this->mInterwiki );
 
@@ -732,8 +738,10 @@ class Title {
                                        $url = "{$wgScript}?title={$dbkey}&{$query}";
                                }
                        }
-
-                       if ($wgRequest->getText('action') == 'render') {
+                       
+                       // FIXME: this causes breakage in various places when we
+                       // actually expected a local URL and end up with dupe prefixes.
+                       if ($wgRequest->getVal('action') == 'render') {
                                $url = $wgServer . $url;
                        }
                }