Merge "Fix Ifb93e49b"
[lhc/web/wiklou.git] / includes / api / ApiQueryAllImages.php
index 2319263..e24b162 100644 (file)
@@ -41,8 +41,8 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
        }
 
        /**
-        * Override parent method to make sure to make sure the repo's DB is used
-        * which may not necesarilly be the same as the local DB.
+        * Override parent method to make sure the repo's DB is used
+        * which may not necessarily be the same as the local DB.
         *
         * TODO: allow querying non-local repos.
         * @return DatabaseBase
@@ -94,7 +94,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                $this->addFields( LocalFile::selectFields() );
 
                $ascendingOrder = true;
-               if ( $params['dir'] == 'descending' || $params['dir'] == 'older') {
+               if ( $params['dir'] == 'descending' || $params['dir'] == 'older' ) {
                        $ascendingOrder = false;
                }
 
@@ -113,10 +113,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                        // Pagination
                        if ( !is_null( $params['continue'] ) ) {
                                $cont = explode( '|', $params['continue'] );
-                               if ( count( $cont ) != 1 ) {
-                                       $this->dieUsage( 'Invalid continue param. You should pass the ' .
-                                               'original value returned by the previous query', '_badcontinue' );
-                               }
+                               $this->dieContinueUsageIf( count( $cont ) != 1 );
                                $op = ( $ascendingOrder ? '>' : '<' );
                                $continueFrom = $db->addQuotes( $cont[0] );
                                $this->addWhere( "img_name $op= $continueFrom" );
@@ -385,7 +382,6 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                        array( 'code' => 'mimesearchdisabled', 'info' => 'MIME search disabled in Miser Mode' ),
                        array( 'code' => 'invalidsha1hash', 'info' => 'The SHA1 hash provided is not valid' ),
                        array( 'code' => 'invalidsha1base36hash', 'info' => 'The SHA1Base36 hash provided is not valid' ),
-                       array( 'code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
                ) );
        }
 
@@ -409,8 +405,4 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
        public function getHelpUrls() {
                return 'https://www.mediawiki.org/wiki/API:Allimages';
        }
-
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
-       }
 }