dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
De-globali[sz]e Special:Allmessages
[lhc/web/wiklou.git]
/
maintenance
/
fixDoubleRedirects.php
diff --git
a/maintenance/fixDoubleRedirects.php
b/maintenance/fixDoubleRedirects.php
index
41458d1
..
a678a92
100644
(file)
--- a/
maintenance/fixDoubleRedirects.php
+++ b/
maintenance/fixDoubleRedirects.php
@@
-44,13
+44,14
@@
class FixDoubleRedirects extends Maintenance {
public function execute() {
$async = $this->getOption( 'async', false );
$dryrun = $this->getOption( 'dry-run', false );
public function execute() {
$async = $this->getOption( 'async', false );
$dryrun = $this->getOption( 'dry-run', false );
- $title = $this->getOption( 'title' );
- if (
isset( $title
) ) {
- $title = Title::newFromText( $t
itle
);
+ if (
$this->hasOption( 'title'
) ) {
+ $title = Title::newFromText( $t
his->getOption( 'title' )
);
if ( !$title || !$title->isRedirect() ) {
$this->error( $title->getPrefixedText() . " is not a redirect!\n", true );
}
if ( !$title || !$title->isRedirect() ) {
$this->error( $title->getPrefixedText() . " is not a redirect!\n", true );
}
+ } else {
+ $title = null;
}
$dbr = wfGetDB( DB_SLAVE );
}
$dbr = wfGetDB( DB_SLAVE );
@@
-75,7
+76,7
@@
class FixDoubleRedirects extends Maintenance {
'pb.page_is_redirect' => 1,
);
'pb.page_is_redirect' => 1,
);
- if (
isset( $title )
) {
+ if (
$title != null
) {
$conds['pb.page_namespace'] = $title->getNamespace();
$conds['pb.page_title'] = $title->getDBkey();
}
$conds['pb.page_namespace'] = $title->getNamespace();
$conds['pb.page_title'] = $title->getDBkey();
}
@@
-85,6
+86,7
@@
class FixDoubleRedirects extends Maintenance {
if ( !$res->numRows() ) {
$this->output( "No double redirects found.\n" );
if ( !$res->numRows() ) {
$this->output( "No double redirects found.\n" );
+
return;
}
return;
}
@@
-106,7
+108,8
@@
class FixDoubleRedirects extends Maintenance {
if ( !$async ) {
$success = ( $dryrun ? true : $job->run() );
if ( !$success ) {
if ( !$async ) {
$success = ( $dryrun ? true : $job->run() );
if ( !$success ) {
- $this->error( "Error fixing " . $titleA->getPrefixedText() . ": " . $job->getLastError() . "\n" );
+ $this->error( "Error fixing " . $titleA->getPrefixedText()
+ . ": " . $job->getLastError() . "\n" );
}
} else {
$jobs[] = $job;
}
} else {
$jobs[] = $job;