From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/api/ApiQueryLangLinks.php | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'includes/api/ApiQueryLangLinks.php') diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index fdba8465..3109a090 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -4,7 +4,7 @@ * * Created on May 13, 2007 * - * Copyright © 2006 Yuri Astrakhan @gmail.com + * Copyright © 2006 Yuri Astrakhan "@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 @@ -60,35 +60,36 @@ class ApiQueryLangLinks extends ApiQueryBase { $this->dieUsage( 'Invalid continue param. You should pass the ' . 'original value returned by the previous query', '_badcontinue' ); } + $op = $params['dir'] == 'descending' ? '<' : '>'; $llfrom = intval( $cont[0] ); - $lllang = $this->getDB()->strencode( $cont[1] ); + $lllang = $this->getDB()->addQuotes( $cont[1] ); $this->addWhere( - "ll_from > $llfrom OR " . + "ll_from $op $llfrom OR " . "(ll_from = $llfrom AND " . - "ll_lang >= '$lllang')" + "ll_lang $op= $lllang)" ); } - $dir = ( $params['dir'] == 'descending' ? ' DESC' : '' ); - if ( isset( $params['lang'] ) ) { + $sort = ( $params['dir'] == 'descending' ? ' DESC' : '' ); + if ( isset( $params['lang'] ) ) { $this->addWhereFld( 'll_lang', $params['lang'] ); if ( isset( $params['title'] ) ) { $this->addWhereFld( 'll_title', $params['title'] ); - $this->addOption( 'ORDER BY', 'll_from' . $dir ); + $this->addOption( 'ORDER BY', 'll_from' . $sort ); } else { $this->addOption( 'ORDER BY', array( - 'll_title' . $dir, - 'll_from' . $dir + 'll_title' . $sort, + 'll_from' . $sort )); } } else { // Don't order by ll_from if it's constant in the WHERE clause if ( count( $this->getPageSet()->getGoodTitles() ) == 1 ) { - $this->addOption( 'ORDER BY', 'll_lang' . $dir ); + $this->addOption( 'ORDER BY', 'll_lang' . $sort ); } else { $this->addOption( 'ORDER BY', array( - 'll_from' . $dir, - 'll_lang' . $dir + 'll_from' . $sort, + 'll_lang' . $sort )); } } @@ -158,6 +159,19 @@ class ApiQueryLangLinks extends ApiQueryBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'lang' => 'string', + 'url' => array( + ApiBase::PROP_TYPE => 'string', + ApiBase::PROP_NULLABLE => true + ), + '*' => 'string' + ) + ); + } + public function getDescription() { return 'Returns all interlanguage links from the given page(s)'; } -- cgit v1.2.3-54-g00ecf