escape HTML elements in docblock with double quotes
[lhc/web/wiklou.git] / includes / api / ApiQueryIWLinks.php
index bc42fe0..e32e287 100644 (file)
@@ -5,7 +5,7 @@
  * Created on May 14, 2010
  *
  * Copyright © 2010 Sam Reed
- * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -76,26 +76,26 @@ class ApiQueryIWLinks extends ApiQueryBase {
                        );
                }
 
-               $dir = ( $params['dir'] == 'descending' ? ' DESC' : '' );
+               $sort = ( $params['dir'] == 'descending' ? ' DESC' : '' );
                if ( isset( $params['prefix'] ) ) {
                        $this->addWhereFld( 'iwl_prefix', $params['prefix'] );
                        if ( isset( $params['title'] ) ) {
                                $this->addWhereFld( 'iwl_title', $params['title'] );
-                               $this->addOption( 'ORDER BY', 'iwl_from' . $dir );
+                               $this->addOption( 'ORDER BY', 'iwl_from' . $sort );
                        } else {
                                $this->addOption( 'ORDER BY', array(
-                                               'iwl_title' . $dir,
-                                               'iwl_from' . $dir
+                                               'iwl_title' . $sort,
+                                               'iwl_from' . $sort
                                ));
                        }
                } else {
                        // Don't order by iwl_from if it's constant in the WHERE clause
                        if ( count( $this->getPageSet()->getGoodTitles() ) == 1 ) {
-                               $this->addOption( 'ORDER BY', 'iwl_prefix' . $dir );
+                               $this->addOption( 'ORDER BY', 'iwl_prefix' . $sort );
                        } else {
                                $this->addOption( 'ORDER BY', array (
-                                               'iwl_from' . $dir,
-                                               'iwl_prefix' . $dir
+                                               'iwl_from' . $sort,
+                                               'iwl_prefix' . $sort
                                ));
                        }
                }
@@ -167,6 +167,19 @@ class ApiQueryIWLinks extends ApiQueryBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'prefix' => 'string',
+                               'url' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               '*' => 'string'
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'Returns all interwiki links from the given page(s)';
        }