dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c546f43
)
Modification to LinkBatch
author
Tim Starling
<tstarling@users.mediawiki.org>
Sun, 3 Apr 2005 08:26:42 +0000
(08:26 +0000)
committer
Tim Starling
<tstarling@users.mediawiki.org>
Sun, 3 Apr 2005 08:26:42 +0000
(08:26 +0000)
includes/LinkCache.php
patch
|
blob
|
history
diff --git
a/includes/LinkCache.php
b/includes/LinkCache.php
index
4ab4482
..
4a57909
100644
(file)
--- a/
includes/LinkCache.php
+++ b/
includes/LinkCache.php
@@
-405,6
+405,9
@@
class LinkBatch {
}
function add( $ns, $dbkey ) {
}
function add( $ns, $dbkey ) {
+ if ( $ns < 0 ) {
+ return;
+ }
if ( !array_key_exists( $ns, $this->data ) ) {
$this->data[$ns] = array();
}
if ( !array_key_exists( $ns, $this->data ) ) {
$this->data[$ns] = array();
}
@@
-458,16
+461,18
@@
class LinkBatch {
$res = $dbr->query( $sql, $fname );
// Process results
$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() );
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
}
$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() );
foreach ( $dbkeys as $dbkey => $nothing ) {
$title = Title::makeTitle( $ns, $dbkey );
$cache->addBadLink( $title->getPrefixedText() );