Merge "Updated result properties in paraminfo API"
[lhc/web/wiklou.git] / includes / api / ApiDelete.php
index 076dc7b..da13a22 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Jun 30, 2007
  *
- * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@gmail.com
+ * Copyright © 2007 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ class ApiDelete extends ApiBase {
                }
 
                $titleObj = $pageObj->getTitle();
-               $reason = ( isset( $params['reason'] ) ? $params['reason'] : null );
+               $reason = $params['reason'];
                $user = $this->getUser();
 
                if ( $titleObj->getNamespace() == NS_FILE ) {
@@ -62,7 +62,7 @@ class ApiDelete extends ApiBase {
                }
 
                if ( !$status->isGood() ) {
-                       $errors = $this->getErrorsArray();
+                       $errors = $status->getErrorsArray();
                        $this->dieUsageMsg( $errors[0] ); // We don't care about multiple errors, just report one of them
                }
 
@@ -180,7 +180,10 @@ class ApiDelete extends ApiBase {
                        'pageid' => array(
                                ApiBase::PARAM_TYPE => 'integer'
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'reason' => null,
                        'watch' => array(
                                ApiBase::PARAM_DFLT => false,