Fix interwiki links in history comments (merged from REL1_4)
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 22 Dec 2004 07:32:29 +0000 (07:32 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 22 Dec 2004 07:32:29 +0000 (07:32 +0000)
includes/Linker.php

index 0b13506..3be5676 100644 (file)
@@ -169,12 +169,16 @@ class Linker {
                                        $trail = $m[2];
                                }
                        }
-                       # Assume $this->postParseLinkColour(). This prevents
-                       # interwiki links from being parsed as external links.
-                       global $wgInterwikiLinkHolders;
                        $t = "<a href=\"{$u}\"{$style}>{$text}{$inside}</a>";
-                       $nr = array_push($wgInterwikiLinkHolders, $t);
-                       $retVal = '<!--IWLINK '. ($nr-1) ."-->{$trail}";
+                       if( $this->postParseLinkColour ) {
+                               # There's no existence check, but this will prevent
+                               # interwiki links from being parsed as external links.
+                               global $wgInterwikiLinkHolders;
+                               $nr = array_push($wgInterwikiLinkHolders, $t);
+                               $retVal = '<!--IWLINK '. ($nr-1) ."-->{$trail}";
+                       } else {
+                               return $t;
+                       }
                } elseif ( 0 == $ns && "" == $dbkey ) {
                        # A self-link with a fragment; skip existence check.
                        $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );