Sanity check report size to avoid division by zero
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 6 Sep 2011 18:02:44 +0000 (18:02 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 6 Sep 2011 18:02:44 +0000 (18:02 +0000)
maintenance/importDump.php

index 3243b56..ed8d80e 100644 (file)
@@ -74,6 +74,10 @@ TEXT;
                }
 
                $this->reportingInterval = intval( $this->getOption( 'report', 100 ) );
+               if ( !$this->reportingInterval ) {
+                       $this->reportingInterval = 100; // avoid division by zero
+               }
+
                $this->dryRun = $this->hasOption( 'dry-run' );
                $this->uploads = $this->hasOption( 'uploads' ); // experimental!
                if ( $this->hasOption( 'image-base-path' ) ) {