Merge "Wrap auto-numbering for section heading in a classed span (bug 33450)"
[lhc/web/wiklou.git] / includes / api / ApiQueryDuplicateFiles.php
index 0132d67..856d0fd 100644 (file)
@@ -91,14 +91,14 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
                        );
                }
 
-               $dir = ( $params['dir'] == 'descending' ? ' DESC' : '' );
+               $sort = ( $params['dir'] == 'descending' ? ' DESC' : '' );
                // Don't order by i1.img_name if it's constant in the WHERE clause
                if ( count( $this->getPageSet()->getGoodTitles() ) == 1 ) {
-                       $this->addOption( 'ORDER BY', 'i2.img_name' . $dir );
+                       $this->addOption( 'ORDER BY', 'i2.img_name' . $sort );
                } else {
                        $this->addOption( 'ORDER BY', array(
-                                       'i1.img_name' . $dir,
-                                       'i2.img_name' . $dir
+                                       'i1.img_name' . $sort,
+                                       'i2.img_name' . $sort
                        ));
                }
                $this->addOption( 'LIMIT', $params['limit'] + 1 );
@@ -165,6 +165,16 @@ class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'name' => 'string',
+                               'user' => 'string',
+                               'timestamp' => 'timestamp'
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'List all files that are duplicates of the given file(s)';
        }