* Use getRedirectTarget() instead of followRedirect(); the latter may return a string, which is not wanted here
* No need to call updateRedirectOn(); getRedirectTarget() already populates the redirect table if needed
__METHOD__ );
return;
}
- $article = new Article( $title );
- $rt = $article->followRedirect();
+ $page = WikiPage::factory( $title );
+ $rt = $page->getRedirectTarget();
- if ( !$rt || !is_object( $rt ) ) {
+ if ( $rt === null ) {
// $title is not a redirect
// Delete any redirect table entry for it
$dbw->delete( 'redirect', array( 'rd_from' => $id ),
__METHOD__ );
- } else {
- $article->updateRedirectOn( $dbw, $rt );
}
}