diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /includes/api/ApiQueryAllLinks.php | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/api/ApiQueryAllLinks.php')
-rw-r--r-- | includes/api/ApiQueryAllLinks.php | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/includes/api/ApiQueryAllLinks.php b/includes/api/ApiQueryAllLinks.php index 78784845..90620e91 100644 --- a/includes/api/ApiQueryAllLinks.php +++ b/includes/api/ApiQueryAllLinks.php @@ -1,6 +1,6 @@ <?php /** - * API for MediaWiki 1.8+ + * * * Created on July 7, 2007 * @@ -52,6 +52,10 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $db = $this->getDB(); $params = $this->extractRequestParams(); @@ -90,27 +94,22 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { ); } - if ( !is_null( $params['from'] ) ) { - $this->addWhere( 'pl_title>=' . $db->addQuotes( $this->titlePartToKey( $params['from'] ) ) ); - } - if ( !is_null( $params['to'] ) ) { - $this->addWhere( 'pl_title<=' . $db->addQuotes( $this->titlePartToKey( $params['to'] ) ) ); - } + $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) ); + $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); + $this->addWhereRange( 'pl_title', 'newer', $from, $to ); + if ( isset( $params['prefix'] ) ) { $this->addWhere( 'pl_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); } - $this->addFields( array( - 'pl_title', - ) ); + $this->addFields( 'pl_title' ); $this->addFieldsIf( 'pl_from', !$params['unique'] ); $this->addOption( 'USE INDEX', 'pl_namespace' ); $limit = $params['limit']; $this->addOption( 'LIMIT', $limit + 1 ); - if ( $params['unique'] ) { - $this->addOption( 'ORDER BY', 'pl_title' ); - } else { + + if ( !$params['unique'] ) { $this->addOption( 'ORDER BY', 'pl_title, pl_from' ); } @@ -228,7 +227,11 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase { ); } + public function getHelpUrls() { + return 'https://www.mediawiki.org/wiki/API:Alllinks'; + } + public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryAllLinks.php 77192 2010-11-23 22:05:27Z btongminh $'; + return __CLASS__ . ': $Id: ApiQueryAllLinks.php 104449 2011-11-28 15:52:04Z reedy $'; } } |