Revert r114067, r114071, r114075, r114079, r114081, r114082, r114084, r114086, r11408...
[lhc/web/wiklou.git] / maintenance / cleanupCaps.php
index 2d945a5..6f8e180 100644 (file)
@@ -40,11 +40,15 @@ class CapsCleanup extends TableCleanup {
 
        public function execute() {
                global $wgCapitalLinks, $wgUser;
+
+               if ( $wgCapitalLinks ) {
+                       $this->error( "\$wgCapitalLinks is on -- no need for caps links cleanup.", true );
+               }
+
+               $wgUser = User::newFromName( 'Conversion script' );
+
                $this->namespace = intval( $this->getOption( 'namespace', 0 ) );
                $this->dryrun = $this->hasOption( 'dry-run' );
-               $wgUser->setName( 'Conversion script' );
-               if ( $wgCapitalLinks )
-                       $this->error( "\$wgCapitalLinks is on -- no need for caps links cleanup.", true );
 
                $this->runTable( array(
                        'table' => 'page',
@@ -88,9 +92,8 @@ class CapsCleanup extends TableCleanup {
                                        return $this->processRow( $row );
                                }
                        }
-               } else {
-                       $this->progress( 0 );
                }
+               return $this->progress( 0 );
        }
 }