More interwiki mucking around -- isLocal() is not the opposite of isExternal()\!
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 26 Jun 2005 13:38:43 +0000 (13:38 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 26 Jun 2005 13:38:43 +0000 (13:38 +0000)
includes/Parser.php
includes/Title.php

index ebed5d5..a0bdcd5 100644 (file)
@@ -1426,7 +1426,7 @@ class Parser
                                $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail );
                                continue;
                        }
-                       if( $nt->isLocal() && $nt->isAlwaysKnown() ) {
+                       if( !$nt->isExternal() && $nt->isAlwaysKnown() ) {
                                /**
                                 * Skip lookups for special pages and self-links.
                                 * External interwiki links are not included here because
@@ -1464,14 +1464,14 @@ class Parser
                        
                        if ( $nt->isExternal() ) {
                                $nr = array_push( $this->mInterwikiLinkHolders['texts'], $prefix.$text.$inside );
-                               $this->mInterwikiLinkHolders['titles'][] =& $nt;
+                               $this->mInterwikiLinkHolders['titles'][] = $nt;
                                $retVal = '<!--IWLINK '. ($nr-1) ."-->{$trail}";
                        } else {
                                $nr = array_push( $this->mLinkHolders['namespaces'], $nt->getNamespace() );
                                $this->mLinkHolders['dbkeys'][] = $nt->getDBkey();
                                $this->mLinkHolders['queries'][] = $query;
                                $this->mLinkHolders['texts'][] = $prefix.$text.$inside;
-                               $this->mLinkHolders['titles'][] =& $nt;
+                               $this->mLinkHolders['titles'][] = $nt;
 
                                $retVal = '<!--LINK '. ($nr-1) ."-->{$trail}";
                        }
index 4f98258..a294343 100644 (file)
@@ -1991,13 +1991,9 @@ class Title {
         * this category. Special pages never exist in the database. Some images do not
         * have description pages in the database, but the description page contains 
         * useful history information that the user may want to link to.
-        * 
-        * Interwiki links are not in this category because of icky pass-interaction 
-        * issues. Anything containing http:// gets mangled later. Local URLs use
-        * relative paths.
         */
        function isAlwaysKnown() {
-               return  ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) 
+               return  $this->isExternal() || ( 0 == $this->mNamespace && "" == $this->mDbkeyform ) 
                  || NS_SPECIAL == $this->mNamespace || NS_IMAGE == $this->mNamespace;
        }