From ec07a4fe7b348bc35ad103a44c5680bd9bc79d74 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 24 Feb 2011 23:03:00 +0000 Subject: [PATCH] Bit of documentation, explicitness, variable definition --- includes/api/ApiQueryCategories.php | 2 +- includes/api/ApiQueryProtectedTitles.php | 3 +++ includes/api/ApiQueryRandom.php | 4 ++++ includes/api/ApiQueryStashImageInfo.php | 2 +- includes/specials/SpecialBlockip.php | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiQueryCategories.php b/includes/api/ApiQueryCategories.php index ba7e5921f1..b8f4a258c0 100644 --- a/includes/api/ApiQueryCategories.php +++ b/includes/api/ApiQueryCategories.php @@ -136,8 +136,8 @@ class ApiQueryCategories extends ApiQueryGeneratorBase { $res = $this->select( __METHOD__ ); + $count = 0; if ( is_null( $resultPageSet ) ) { - $count = 0; foreach ( $res as $row ) { if ( ++$count > $params['limit'] ) { // We've reached the one extra which shows that diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index 14f4e6c967..a3f011990a 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -81,6 +81,9 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase { $count = 0; $result = $this->getResult(); + + $titles = array(); + foreach ( $res as $row ) { if ( ++ $count > $params['limit'] ) { // We've reached the one extra which shows that there are additional pages to be had. Stop here... diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php index 9c1f9ede1c..51ae0e2d3c 100644 --- a/includes/api/ApiQueryRandom.php +++ b/includes/api/ApiQueryRandom.php @@ -100,6 +100,10 @@ class ApiQueryRandom extends ApiQueryGeneratorBase { return $count; } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ public function run( $resultPageSet = null ) { $params = $this->extractRequestParams(); $result = $this->getResult(); diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index e3fdbea695..e82932629b 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -47,7 +47,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { foreach ( $params['sessionkey'] as $sessionkey ) { $file = $stash->getFile( $sessionkey ); $finalThumbParam = $this->mergeThumbParams( $file, $scale, $params['urlparam'] ); - $imageInfo = self::getInfo( $file, $prop, $result, $finalThumbParam ); + $imageInfo = ApiQueryImageInfo::getInfo( $file, $prop, $result, $finalThumbParam ); $result->addValue( array( 'query', $this->getModuleName() ), null, $imageInfo ); $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), $modulePrefix ); } diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 1148d304cb..690d3bcd43 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -29,7 +29,7 @@ */ class IPBlockForm extends SpecialPage { var $BlockAddress, $BlockExpiry, $BlockReason, $BlockReasonList, $BlockOther, $BlockAnonOnly, $BlockCreateAccount, - $BlockEnableAutoblock, $BlockEmail, $BlockHideName, $BlockAllowUsertalk, $BlockReblock; + $BlockEnableAutoblock, $BlockEmail, $BlockHideName, $BlockAllowUsertalk, $BlockReblock, $BlockWatchUser; // The maximum number of edits a user can have and still be hidden const HIDEUSER_CONTRIBLIMIT = 1000; -- 2.20.1