From e19fe926f395382d9dc9bff1b8cf969a3abb5760 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Wed, 9 May 2007 21:09:59 +0000 Subject: [PATCH] apply stub threshold to all content namespaces --- includes/Linker.php | 2 +- includes/Parser.php | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) 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' ); -- 2.20.1