Followup to r70460: Committed wrong version of ApiBase.php, convert all core API...
[lhc/web/wiklou.git] / includes / api / ApiRollback.php
index 5f6f5c6..40a88dc 100644 (file)
@@ -77,8 +77,14 @@ class ApiRollback extends ApiBase {
 
        public function getAllowedParams() {
                return array(
-                       'title' => null,
-                       'user' => null,
+                       'title' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => 1
+                       ),
+                       'user' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => 1
+                       ),
                        'token' => null,
                        'summary' => null,
                        'markbot' => false,
@@ -133,10 +139,6 @@ class ApiRollback extends ApiBase {
 
                $params = $this->extractRequestParams();
 
-               if ( !isset( $params['user'] ) ) {
-                       $this->dieUsageMsg( array( 'missingparam', 'user' ) );
-               }
-
                // We need to be able to revert IPs, but getCanonicalName rejects them
                $this->mUser = User::isIP( $params['user'] )
                        ? $params['user']
@@ -154,9 +156,6 @@ class ApiRollback extends ApiBase {
                }
 
                $params = $this->extractRequestParams();
-               if ( !isset( $params['title'] ) ) {
-                       $this->dieUsageMsg( array( 'missingparam', 'title' ) );
-               }
 
                $this->mTitleObj = Title::newFromText( $params['title'] );