X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FfixDoubleRedirects.php;h=a76617aa7f68df83a3c90309dcad5b58c4b6adfb;hb=9f381111d512c030bb9149b9502abfb9607a383e;hp=0592d2da51bb31a0b6b6711265369c01d286fc6f;hpb=4b73a8b6fbb6da651af850a7d667e6e8d59e6fce;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixDoubleRedirects.php b/maintenance/fixDoubleRedirects.php index 0592d2da51..a76617aa7f 100644 --- a/maintenance/fixDoubleRedirects.php +++ b/maintenance/fixDoubleRedirects.php @@ -42,19 +42,19 @@ class FixDoubleRedirects extends Maintenance { } public function execute() { - $async = $this->getOption( 'async', false ); - $dryrun = $this->getOption( 'dry-run', false ); + $async = $this->hasOption( 'async' ); + $dryrun = $this->hasOption( 'dry-run' ); if ( $this->hasOption( 'title' ) ) { $title = Title::newFromText( $this->getOption( 'title' ) ); if ( !$title || !$title->isRedirect() ) { - $this->error( $title->getPrefixedText() . " is not a redirect!\n", true ); + $this->fatalError( $title->getPrefixedText() . " is not a redirect!\n" ); } } else { $title = null; } - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); // See also SpecialDoubleRedirects $tables = [ @@ -72,7 +72,7 @@ class FixDoubleRedirects extends Maintenance { 'rd_from = pa.page_id', 'rd_namespace = pb.page_namespace', 'rd_title = pb.page_title', - 'rd_interwiki IS NULL OR rd_interwiki = ' . $dbr->addQuotes( '' ), // bug 40352 + 'rd_interwiki IS NULL OR rd_interwiki = ' . $dbr->addQuotes( '' ), // T42352 'pb.page_is_redirect' => 1, ]; @@ -136,5 +136,5 @@ class FixDoubleRedirects extends Maintenance { } } -$maintClass = "FixDoubleRedirects"; +$maintClass = FixDoubleRedirects::class; require_once RUN_MAINTENANCE_IF_MAIN;