With the introduction of action=render, internal links may also contain http://,...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 20 Aug 2005 13:47:12 +0000 (13:47 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 20 Aug 2005 13:47:12 +0000 (13:47 +0000)
includes/Parser.php

index 40afaed..eede52a 100644 (file)
@@ -1456,27 +1456,20 @@ class Parser
                                $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail );
                                continue;
                        }
-                       if( !$nt->isExternal() && $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 {
-                               /**
-                                * Add a link placeholder
-                                * Later, this will be replaced by a real link, after the existence or
-                                * non-existence of all the links is known
-                                */
-                               $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix );
-                       }
+                       $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix );
                }
                wfProfileOut( $fname );
                return $s;
        }
 
+       /**
+        * Hardens some text possibly containing URLs against mangling by 
+        * replaceExternalLinks()
+        */
+       function hardenURLs( $text ) {
+               return str_replace( 'http://', 'http-noparse://', $text );
+       }
+
        /**
         * Make a link placeholder. The text returned can be later resolved to a real link with
         * replaceLinkHolders(). This is done for two reasons: firstly to avoid further
@@ -3023,7 +3016,7 @@ class Parser
                                $pdbk = $pdbks[$key] = $title->getPrefixedDBkey();
 
                                # Check if it's in the link cache already
-                               if ( $wgLinkCache->getGoodLinkID( $pdbk ) ) {
+                               if ( $title->isAlwaysKnown() || $wgLinkCache->getGoodLinkID( $pdbk ) ) {
                                        $colours[$pdbk] = 1;
                                } elseif ( $wgLinkCache->isBadLink( $pdbk ) ) {
                                        $colours[$pdbk] = 0;