* (bug 2372) Fix rendering of empty-title inline interwiki links
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 11 Jun 2005 01:54:03 +0000 (01:54 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 11 Jun 2005 01:54:03 +0000 (01:54 +0000)
RELEASE-NOTES
includes/Parser.php
includes/Title.php
maintenance/parserTests.txt

index 7763238..34ef2bf 100644 (file)
@@ -275,6 +275,7 @@ Various bugfixes, small features, and a few experimental things:
 * Changed user_groups format quite a bit.
 * (bug 2368) Avoid fatally breaking PHP 4.1.2 in a debug line
 * (bug 2367) Insert correct redirect link record on page move
+* (bug 2372) Fix rendering of empty-title inline interwiki links
 
 
 === Caveats ===
index 0c7a142..fd9b960 100644 (file)
@@ -1433,7 +1433,13 @@ class Parser
                                $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail );
                                continue;
                        }
-                       if ( $nt->isAlwaysKnown() ) {
+                       if( $nt->isLocal() && $nt->isAlwaysKnown() ) {
+                               /**
+                                * Skip lookups for special pages and self-links.
+                                * External interwiki links are not included here because
+                                * the HTTP urls would break output in the next parse step;
+                                * they will have placeholders kept.
+                                */
                                $s .= $sk->makeKnownLinkObj( $nt, $text, '', $trail, $prefix );
                        } else {
                                /**
index 2c5111a..92d813a 100644 (file)
@@ -1969,7 +1969,7 @@ class Title {
         * 
         */
        function isAlwaysKnown() {
-               return ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) 
+               return $this->isExternal() || ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) 
                  || NS_SPECIAL == $this->mNamespace || NS_IMAGE == $this->mNamespace;
        }
 
index 846ed08..f644fe2 100644 (file)
@@ -1069,6 +1069,15 @@ Inline interwiki link
 </p>
 !! end
 
+!! test
+Inline interwiki link with empty title (bug 2372)
+!! input
+[[MeatBall:]]
+!! result
+<p><a href="http://www.usemod.com/cgi-bin/mb.pl?" class='extiw' title="MeatBall:">MeatBall:</a>
+</p>
+!! end
+
 !! test
 Interwiki link encoding conversion (bug 1636)
 !! input