diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /maintenance/checkBadRedirects.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'maintenance/checkBadRedirects.php')
-rw-r--r-- | maintenance/checkBadRedirects.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/maintenance/checkBadRedirects.php b/maintenance/checkBadRedirects.php index 32f04f45..52bfa65a 100644 --- a/maintenance/checkBadRedirects.php +++ b/maintenance/checkBadRedirects.php @@ -18,10 +18,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ - -require_once( dirname(__FILE__) . '/Maintenance.php' ); + +require_once( dirname( __FILE__ ) . '/Maintenance.php' ); class CheckBadRedirects extends Maintenance { public function __construct() { @@ -34,19 +35,19 @@ class CheckBadRedirects extends Maintenance { $dbr = wfGetDB( DB_SLAVE ); $result = $dbr->select( array( 'page' ), - array( 'page_namespace','page_title', 'page_latest' ), + array( 'page_namespace', 'page_title', 'page_latest' ), array( 'page_is_redirect' => 1 ) ); - + $count = $result->numRows(); $this->output( "Found $count total redirects.\n" . "Looking for bad redirects:\n\n" ); - - foreach( $result as $row ) { + + foreach ( $result as $row ) { $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $rev = Revision::newFromId( $row->page_latest ); - if( $rev ) { + if ( $rev ) { $target = Title::newFromRedirect( $rev->getText() ); - if( !$target ) { + if ( !$target ) { $this->output( $title->getPrefixedText() . "\n" ); } } @@ -56,4 +57,4 @@ class CheckBadRedirects extends Maintenance { } $maintClass = "CheckBadRedirects"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); |