Update formatting in maintenance/ (3/4)
[lhc/web/wiklou.git] / maintenance / checkBadRedirects.php
index 670b93d..fec9291 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script to check that pages marked as being redirects really are.
@@ -44,13 +44,13 @@ class CheckBadRedirects extends Maintenance {
 
                $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" );
                                }
@@ -61,4 +61,4 @@ class CheckBadRedirects extends Maintenance {
 }
 
 $maintClass = "CheckBadRedirects";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;