From 585c981d9c994a51c99680122df1d4a058ea1c1c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 25 Mar 2010 21:15:35 +0000 Subject: [PATCH] Stop mutually exclusive values in ApiProtect Fix fail in Delete, Move, Rollback, Undelete --- includes/api/ApiDelete.php | 2 +- includes/api/ApiMove.php | 2 +- includes/api/ApiProtect.php | 4 ++++ includes/api/ApiRollback.php | 2 +- includes/api/ApiUndelete.php | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index aca6b63740..2d6debcd15 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -53,7 +53,7 @@ class ApiDelete extends ApiBase { $this->requireOnlyOneParameter( $params, 'title', 'pageid' ); - if ( isset( $params['watch'] ) && params( $show['unwatch'] ) ) { + if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) { $this->dieUsageMsg( array( 'show' ) ); } diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index f7a5f9ae61..0def28e226 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -40,7 +40,7 @@ class ApiMove extends ApiBase { global $wgUser; $params = $this->extractRequestParams(); - if ( isset( $params['watch'] ) && params( $show['unwatch'] ) ) { + if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) { $this->dieUsageMsg( array( 'show' ) ); } diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 47b87b4f18..cf593b97c0 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -39,6 +39,10 @@ class ApiProtect extends ApiBase { public function execute() { global $wgUser, $wgRestrictionTypes, $wgRestrictionLevels; $params = $this->extractRequestParams(); + + if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) { + $this->dieUsageMsg( array( 'show' ) ); + } $titleObj = null; if ( !isset( $params['title'] ) ) { diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 7db4a17827..e30a6c09f6 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -39,7 +39,7 @@ class ApiRollback extends ApiBase { public function execute() { $params = $this->extractRequestParams(); - if ( isset( $params['watch'] ) && params( $show['unwatch'] ) ) { + if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) { $this->dieUsageMsg( array( 'show' ) ); } diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 470bfe8aef..c29916be92 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -40,7 +40,7 @@ class ApiUndelete extends ApiBase { global $wgUser; $params = $this->extractRequestParams(); - if ( isset( $params['watch'] ) && params( $show['unwatch'] ) ) { + if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) { $this->dieUsageMsg( array( 'show' ) ); } -- 2.20.1