X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrollbackEdits.php;h=967dda85cee1455c8d0d487c710ed8ae564dfe2c;hb=8d71f214fb2cd0eea116c66c45009a276bd5be09;hp=305fea8ade1bbe66d0aaaa551ecacc3cc5d4bf1e;hpb=ea4340e126eb2657cc878af74d53b9991844fb6b;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rollbackEdits.php b/maintenance/rollbackEdits.php index 305fea8ade..967dda85ce 100644 --- a/maintenance/rollbackEdits.php +++ b/maintenance/rollbackEdits.php @@ -22,7 +22,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script to rollback all edits by a given user or IP provided @@ -33,8 +33,14 @@ require_once( __DIR__ . '/Maintenance.php' ); class RollbackEdits extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Rollback all edits by a given user or IP provided they're the most recent edit"; - $this->addOption( 'titles', 'A list of titles, none means all titles where the given user is the most recent', false, true ); + $this->mDescription = + "Rollback all edits by a given user or IP provided they're the most recent edit"; + $this->addOption( + 'titles', + 'A list of titles, none means all titles where the given user is the most recent', + false, + true + ); $this->addOption( 'user', 'A user or IP to rollback all edits for', true, true ); $this->addOption( 'summary', 'Edit summary to use', false, true ); $this->addOption( 'bot', 'Mark the edits as bot' ); @@ -66,6 +72,7 @@ class RollbackEdits extends Maintenance { if ( !$titles ) { $this->output( 'No suitable titles to be rolled back' ); + return; } @@ -84,7 +91,7 @@ class RollbackEdits extends Maintenance { /** * Get all pages that should be rolled back for a given user - * @param $user String a name to check against rev_user_text + * @param string $user A name to check against rev_user_text * @return array */ private function getRollbackTitles( $user ) { @@ -99,6 +106,7 @@ class RollbackEdits extends Maintenance { foreach ( $results as $row ) { $titles[] = Title::makeTitle( $row->page_namespace, $row->page_title ); } + return $titles; } }