* (bug 21535) RecentChanges RSS feed now always recognises the namespace filter,
previously it sometimes didn't due to caching.
* (bug 20388) ProfilerSimpleText no longer outputs comment on action=raw
+* refreshLinks.php now purges orphaned redirect table rows
== API changes in 1.16 ==
}
} else {
if ( !$end ) {
- $end = $dbr->selectField( 'page', 'max(page_id)', false );
+ $maxPage = $dbr->selectField( 'page', 'max(page_id)', false );
+ $maxRD = $dbr->selectField( 'redirect', 'max(rd_from)', false );
+ $end = max( $maxPage, $maxRD );
}
$this->output( "Refreshing redirects table.\n" );
$this->output( "Starting from page_id $start of $end.\n" );
$dbw = wfGetDB( DB_MASTER );
if ( is_null( $wgTitle ) ) {
+ // This page doesn't exist (any more)
+ // Delete any redirect table entry for it
+ $dbw->delete( 'redirect', array( 'rd_from' => $id ),
+ __METHOD__ );
return;
}
$wgArticle = new Article($wgTitle);
$rt = $wgArticle->followRedirect();
- if($rt == false || !is_object($rt))
- return;
-
- $wgArticle->updateRedirectOn($dbw,$rt);
+ if($rt == false || !is_object($rt)) {
+ // $wgTitle is not a redirect
+ // Delete any redirect table entry for it
+ $dbw->delete( 'redirect', array( 'rd_from' => $id ),
+ __METHOD__ );
+ } else {
+ $wgArticle->updateRedirectOn($dbw,$rt);
+ }
}
/**