Avoid stupid queries in LinkHolderArray
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 30 Aug 2010 18:16:43 +0000 (18:16 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Mon, 30 Aug 2010 18:16:43 +0000 (18:16 +0000)
Title::isAlwaysKnown will return true for all existing special pages, so the rest don't exists

includes/parser/LinkHolderArray.php

index f6a6610..aad88b7 100644 (file)
@@ -159,7 +159,7 @@ class LinkHolderArray {
                $current = null;
                foreach ( $this->internals as $ns => $entries ) {
                        foreach ( $entries as $index => $entry ) {
-                               $key =  "$ns:$index";
+                               $key = "$ns:$index";
                                $title = $entry['title'];
                                $pdbk = $entry['pdbk'];
 
@@ -172,6 +172,8 @@ class LinkHolderArray {
                                # Check if it's a static known link, e.g. interwiki
                                if ( $title->isAlwaysKnown() ) {
                                        $colours[$pdbk] = '';
+                               } elseif ( $ns == NS_SPECIAL ) {
+                                       $colours[$pdbk] = 'new';
                                } elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) {
                                        $colours[$pdbk] = $sk->getLinkColour( $title, $threshold );
                                        $output->addLink( $title, $id );