Apply ^demon's patch. Reason was: fixes mismatched <tbody> issue from when child...
[lhc/web/wiklou.git] / maintenance / checkImages.php
index 534c5c2..378caa3 100644 (file)
@@ -11,7 +11,8 @@ $numImages = 0;
 $numGood = 0;
 
 do {
-       $res = $dbr->select( 'image', '*', array( 'img_name > ' . $dbr->addQuotes( $start ) ) );
+       $res = $dbr->select( 'image', '*', array( 'img_name > ' . $dbr->addQuotes( $start ) ), 
+               'checkImages.php', array( 'LIMIT' => $batchSize ) );
        foreach ( $res as $row ) {
                $numImages++;
                $start = $row->img_name;
@@ -27,13 +28,18 @@ do {
                        continue;
                }
 
+               if ( $stat['mode'] & 040000 ) {
+                       echo "{$row->img_name}: is a directory\n";
+                       continue;
+               }
+
                if ( $stat['size'] == 0 && $row->img_size != 0 ) {
                        echo "{$row->img_name}: truncated, was {$row->img_size}\n";
                        continue;
                }
 
                if ( $stat['size'] != $row->img_size ) {
-                       echo "{$row->img_name}: size mismatch DB={$row->img_size}, actual={$row->img_size}\n";
+                       echo "{$row->img_name}: size mismatch DB={$row->img_size}, actual={$stat['size']}\n";
                        continue;
                }