Merge "Add a 'revdelete-selected-file' message on Special:RevisionDelete"
[lhc/web/wiklou.git] / includes / api / ApiQueryAllImages.php
index 9f97cac..6e2c31f 100644 (file)
@@ -132,13 +132,14 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                        }
 
                        // Image filters
-                       $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
-                       $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
+                       $from = ( $params['from'] === null ? null : $this->titlePartToKey( $params['from'], NS_FILE ) );
+                       $to = ( $params['to'] === null ? null : $this->titlePartToKey( $params['to'], NS_FILE ) );
                        $this->addWhereRange( 'img_name', ( $ascendingOrder ? 'newer' : 'older' ), $from, $to );
 
                        if ( isset( $params['prefix'] ) ) {
-                               $this->addWhere( 'img_name' .
-                                       $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+                               $this->addWhere( 'img_name' . $db->buildLike(
+                                       $this->titlePartToKey( $params['prefix'], NS_FILE ),
+                                       $db->anyString() ) );
                        }
                } else {
                        // Check mutually exclusive params
@@ -377,7 +378,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
                );
        }
 
-       private $propertyFilter = array( 'archivename', 'thumbmime' );
+       private $propertyFilter = array( 'archivename', 'thumbmime', 'uploadwarning' );
 
        public function getResultProperties() {
                return array_merge(
@@ -393,7 +394,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase {
        }
 
        public function getDescription() {
-               return 'Enumerate all images sequentially';
+               return 'Enumerate all images sequentially.';
        }
 
        public function getPossibleErrors() {