From: Niklas Laxström Date: Mon, 30 Aug 2010 18:16:43 +0000 (+0000) Subject: Avoid stupid queries in LinkHolderArray X-Git-Tag: 1.31.0-rc.0~35271 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=c8e109f003eca55f7575f8c594f319faf000d740;p=lhc%2Fweb%2Fwiklou.git Avoid stupid queries in LinkHolderArray Title::isAlwaysKnown will return true for all existing special pages, so the rest don't exists --- diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index f6a66104f6..aad88b747a 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -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 );