r22055 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22054‎ | r22055 | r22056 >
Date:21:09, 9 May 2007
Author:vyznev
Status:old
Tags:
Comment:
apply stub threshold to all content namespaces
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -224,7 +224,7 @@
225225 $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix );
226226 } else {
227227 $stub = false;
228 - if ( $nt->getNamespace() == NS_MAIN ) {
 228+ if ( $nt->isContentPage() ) {
229229 $threshold = $wgUser->getOption('stubthreshold');
230230 if ( $threshold > 0 ) {
231231 $dbr = wfGetDB( DB_SLAVE );
Index: trunk/phase3/includes/Parser.php
@@ -4074,16 +4074,10 @@
40754075 $linkCache->addGoodLinkObj( $s->page_id, $title );
40764076 $this->mOutput->addLink( $title, $s->page_id );
40774077
4078 - if ( $threshold > 0 ) {
4079 - $size = $s->page_len;
4080 - if ( $s->page_is_redirect || $s->page_namespace != 0 || $size >= $threshold ) {
4081 - $colours[$pdbk] = 1;
4082 - } else {
4083 - $colours[$pdbk] = 2;
4084 - }
4085 - } else {
4086 - $colours[$pdbk] = 1;
4087 - }
 4078+ $colours[$pdbk] = ( $s->page_len >= $threshold || # always true if $threshold <= 0
 4079+ $s->page_is_redirect ||
 4080+ !Namespace::isContent( $s->page_namespace )
 4081+ ? 1 : 2 );
40884082 }
40894083 }
40904084 wfProfileOut( $fname.'-check' );