* @ingroup Maintenance
*/
-require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script to check that pages marked as being redirects really are.
$count = $result->numRows();
$this->output( "Found $count redirects.\n" .
- "Checking for bad redirects:\n\n" );
+ "Checking for bad redirects:\n\n" );
foreach ( $result as $row ) {
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
$rev = Revision::newFromId( $row->page_latest );
if ( $rev ) {
- $target = Title::newFromRedirect( $rev->getText() );
+ $target = $rev->getContent()->getRedirectTarget();
if ( !$target ) {
$this->output( $title->getPrefixedText() . "\n" );
}
}
$maintClass = "CheckBadRedirects";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;