From: Ilmari Karonen Date: Wed, 9 May 2007 21:09:59 +0000 (+0000) Subject: apply stub threshold to all content namespaces X-Git-Tag: 1.31.0-rc.0~52987 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=e19fe926f395382d9dc9bff1b8cf969a3abb5760;p=lhc%2Fweb%2Fwiklou.git apply stub threshold to all content namespaces --- diff --git a/includes/Linker.php b/includes/Linker.php index f6222d8c9c..578cd09db8 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -224,7 +224,7 @@ class Linker { $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix ); } else { $stub = false; - if ( $nt->getNamespace() == NS_MAIN ) { + if ( $nt->isContentPage() ) { $threshold = $wgUser->getOption('stubthreshold'); if ( $threshold > 0 ) { $dbr = wfGetDB( DB_SLAVE ); diff --git a/includes/Parser.php b/includes/Parser.php index 740dbd2518..966b82c3f2 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4074,16 +4074,10 @@ class Parser $linkCache->addGoodLinkObj( $s->page_id, $title ); $this->mOutput->addLink( $title, $s->page_id ); - if ( $threshold > 0 ) { - $size = $s->page_len; - if ( $s->page_is_redirect || $s->page_namespace != 0 || $size >= $threshold ) { - $colours[$pdbk] = 1; - } else { - $colours[$pdbk] = 2; - } - } else { - $colours[$pdbk] = 1; - } + $colours[$pdbk] = ( $s->page_len >= $threshold || # always true if $threshold <= 0 + $s->page_is_redirect || + !Namespace::isContent( $s->page_namespace ) + ? 1 : 2 ); } } wfProfileOut( $fname.'-check' );