SECURITY: Escape internal error message
[lhc/web/wiklou.git] / maintenance / refreshFileHeaders.php
index fd3faeb..bd625ba 100644 (file)
@@ -57,6 +57,8 @@ class RefreshFileHeaders extends Maintenance {
                $count = 0;
                $dbr = $this->getDB( DB_REPLICA );
 
+               $fileQuery = LocalFile::getQueryInfo();
+
                do {
                        $conds = [ "img_name > {$dbr->addQuotes( $start )}" ];
 
@@ -76,8 +78,16 @@ class RefreshFileHeaders extends Maintenance {
                                $conds[] = "img_minor_mime = {$dbr->addQuotes( $minor_mime )}";
                        }
 
-                       $res = $dbr->select( 'image', '*', $conds,
-                               __METHOD__, [ 'LIMIT' => $this->mBatchSize, 'ORDER BY' => 'img_name ASC' ] );
+                       $res = $dbr->select( $fileQuery['tables'],
+                               $fileQuery['fields'],
+                               $conds,
+                               __METHOD__,
+                               [
+                                       'LIMIT' => $this->getBatchSize(),
+                                       'ORDER BY' => 'img_name ASC'
+                               ],
+                               $fileQuery['joins']
+                       );
 
                        if ( $res->numRows() > 0 ) {
                                $row1 = $res->current();
@@ -119,7 +129,7 @@ class RefreshFileHeaders extends Maintenance {
 
                        $this->output( "Updating headers for {$backendOperationsCount} file(s).\n" );
                        $this->updateFileHeaders( $repo, $backendOperations );
-               } while ( $res->numRows() === $this->mBatchSize );
+               } while ( $res->numRows() === $this->getBatchSize() );
 
                $this->output( "Done. Updated headers for $count file(s).\n" );
        }