From: Aaron Schulz Date: Wed, 4 Nov 2015 22:04:56 +0000 (-0800) Subject: FindOrphanedFiles cleanups X-Git-Tag: 1.31.0-rc.0~9099 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=c98a1c336174a30547d9f397ff5887650b8f4cce;p=lhc%2Fweb%2Fwiklou.git FindOrphanedFiles cleanups * Avoid empty DB list errors for some batches * Use more convenient cannonical URLs Change-Id: I37f59e0747525603828897196eabd6c64740aa02 --- 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" ); } } }