From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/api/ApiQueryBacklinks.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'includes/api/ApiQueryBacklinks.php') diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 3ef6b840..2d1089a7 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -229,10 +229,10 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $orderBy = array(); $sort = ( $this->params['dir'] == 'descending' ? ' DESC' : '' ); // Don't order by namespace/title if it's constant in the WHERE clause - if( $this->hasNS && count( array_unique( $allRedirNs ) ) != 1 ) { + if ( $this->hasNS && count( array_unique( $allRedirNs ) ) != 1 ) { $orderBy[] = $this->bl_ns . $sort; } - if( count( array_unique( $allRedirDBkey ) ) != 1 ) { + if ( count( array_unique( $allRedirDBkey ) ) != 1 ) { $orderBy[] = $this->bl_title . $sort; } $orderBy[] = $this->bl_from . $sort; @@ -255,6 +255,9 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if ( $this->params['limit'] == 'max' ) { $this->params['limit'] = $this->getMain()->canApiHighLimits() ? $botMax : $userMax; $result->setParsedLimit( $this->getModuleName(), $this->params['limit'] ); + } else { + $this->params['limit'] = intval( $this->params['limit'] ); + $this->validateLimit( 'limit', $this->params['limit'], 1, $userMax, $botMax ); } $this->processContinue(); @@ -294,9 +297,9 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { // We've reached the one extra which shows that there are additional pages to be had. Stop here... // We need to keep the parent page of this redir in if ( $this->hasNS ) { - $parentID = $this->pageMap[$row-> { $this->bl_ns } ][$row-> { $this->bl_title } ]; + $parentID = $this->pageMap[$row->{$this->bl_ns}][$row->{$this->bl_title}]; } else { - $parentID = $this->pageMap[NS_FILE][$row-> { $this->bl_title } ]; + $parentID = $this->pageMap[NS_FILE][$row->{$this->bl_title}]; } $this->continueStr = $this->getContinueRedirStr( $parentID, $row->page_id ); break; @@ -377,8 +380,8 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if ( $row->page_is_redirect ) { $a['redirect'] = ''; } - $ns = $this->hasNS ? $row-> { $this->bl_ns } : NS_FILE; - $parentID = $this->pageMap[$ns][$row-> { $this->bl_title } ]; + $ns = $this->hasNS ? $row->{$this->bl_ns} : NS_FILE; + $parentID = $this->pageMap[$ns][$row->{$this->bl_title}]; // Put all the results in an array first $this->resultArr[$parentID]['redirlinks'][] = $a; $this->getResult()->setIndexedTagName( $this->resultArr[$parentID]['redirlinks'], $this->bl_code ); -- cgit v1.2.3-54-g00ecf