From c98a1c336174a30547d9f397ff5887650b8f4cce Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 4 Nov 2015 14:04:56 -0800 Subject: [PATCH] FindOrphanedFiles cleanups * Avoid empty DB list errors for some batches * Use more convenient cannonical URLs Change-Id: I37f59e0747525603828897196eabd6c64740aa02 --- maintenance/findOrphanedFiles.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/maintenance/findOrphanedFiles.php b/maintenance/findOrphanedFiles.php index 2ee406fe58..eac277aa50 100644 --- a/maintenance/findOrphanedFiles.php +++ b/maintenance/findOrphanedFiles.php @@ -105,12 +105,12 @@ class FindOrphanedFiles extends Maintenance { $dbr->selectSQLText( 'image', array( 'name' => 'img_name' ), - array( 'img_name' => $imgIN ) + $imgIN ? array( 'img_name' => $imgIN ) : '1=0' ), $dbr->selectSQLText( 'oldimage', array( 'name' => 'oi_archive_name' ), - $dbr->makeList( $oiWheres, LIST_OR ) + $oiWheres ? $dbr->makeList( $oiWheres, LIST_OR ) : '1=0' ) ), true // UNION ALL (performance) @@ -132,7 +132,7 @@ class FindOrphanedFiles extends Maintenance { } else { $file = $repo->newFile( $name ); } - $this->output( $name . "\n" . $file->getUrl() . "\n\n" ); + $this->output( $name . "\n" . $file->getCanonicalUrl() . "\n\n" ); } } } -- 2.20.1