Merge "Correct case for the "MediaWiki:Revdelete-reason-dropdown" link in Special...
[lhc/web/wiklou.git] / includes / api / ApiQueryLangBacklinks.php
index 4233560..f423719 100644 (file)
@@ -61,14 +61,15 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase {
                                        'original value returned by the previous query', '_badcontinue' );
                        }
 
-                       $prefix = $this->getDB()->strencode( $cont[0] );
-                       $title = $this->getDB()->strencode( $this->titleToKey( $cont[1] ) );
+                       $db = $this->getDB();
+                       $prefix = $db->addQuotes( $cont[0] );
+                       $title = $db->addQuotes( $this->titleToKey( $cont[1] ) );
                        $from = intval( $cont[2] );
                        $this->addWhere(
-                               "ll_lang > '$prefix' OR " .
-                               "(ll_lang = '$prefix' AND " .
-                               "(ll_title > '$title' OR " .
-                               "(ll_title = '$title' AND " .
+                               "ll_lang > $prefix OR " .
+                               "(ll_lang = $prefix AND " .
+                               "(ll_title > $title OR " .
+                               "(ll_title = $title AND " .
                                "ll_from >= $from)))"
                        );
                }
@@ -194,6 +195,23 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'pageid' => 'integer',
+                               'ns' => 'namespace',
+                               'title' => 'string',
+                               'redirect' => 'boolean'
+                       ),
+                       'lllang' => array(
+                               'lllang' => 'string'
+                       ),
+                       'lltitle' => array(
+                               'lltitle' => 'string'
+                       )
+               );
+       }
+
        public function getDescription() {
                return array( 'Find all pages that link to the given language link.',
                        'Can be used to find all links with a language code, or',