From 3d91a20b4560a34f4ffbb29863fe004190194484 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 3 Apr 2005 08:26:42 +0000 Subject: [PATCH] Modification to LinkBatch --- includes/LinkCache.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 4ab4482144..4a57909494 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -405,6 +405,9 @@ class LinkBatch { } function add( $ns, $dbkey ) { + if ( $ns < 0 ) { + return; + } if ( !array_key_exists( $ns, $this->data ) ) { $this->data[$ns] = array(); } @@ -458,16 +461,18 @@ class LinkBatch { $res = $dbr->query( $sql, $fname ); // Process results - // For each returned entry, add it to the list of good links, and remove it from $data + // For each returned entry, add it to the list of good links, and remove it from $remaining + + $remaining = $this->data; while ( $row = $dbr->fetchObject( $res ) ) { $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $cache->addGoodLink( $row->page_id, $title->getPrefixedDBkey() ); - unset( $this->data[$row->page_namespace][$row->page_title] ); + unset( $remaining[$row->page_namespace][$row->page_title] ); } $dbr->freeResult( $res ); // The remaining links in $data are bad links, register them as such - foreach ( $this->data as $ns => $dbkeys ) { + foreach ( $remaining as $ns => $dbkeys ) { foreach ( $dbkeys as $dbkey => $nothing ) { $title = Title::makeTitle( $ns, $dbkey ); $cache->addBadLink( $title->getPrefixedText() ); -- 2.20.1