summaryrefslogtreecommitdiff
path: root/includes/api/ApiProtect.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiProtect.php')
-rw-r--r--includes/api/ApiProtect.php13
1 files changed, 2 insertions, 11 deletions
diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php
index b3ca67e6..7830c8b4 100644
--- a/includes/api/ApiProtect.php
+++ b/includes/api/ApiProtect.php
@@ -29,10 +29,6 @@
*/
class ApiProtect extends ApiBase {
- public function __construct( $main, $action ) {
- parent::__construct( $main, $action );
- }
-
public function execute() {
global $wgRestrictionLevels;
$params = $this->extractRequestParams();
@@ -107,8 +103,7 @@ class ApiProtect extends ApiBase {
$status = $pageObj->doUpdateRestrictions( $protections, $expiryarray, $cascade, $params['reason'], $this->getUser() );
if ( !$status->isOK() ) {
- $errors = $status->getErrorsArray();
- $this->dieUsageMsg( $errors[0] );
+ $this->dieStatus( $status );
}
$res = array(
'title' => $titleObj->getPrefixedText(),
@@ -178,7 +173,7 @@ class ApiProtect extends ApiBase {
'token' => 'A protect token previously retrieved through prop=info',
'protections' => 'List of protection levels, formatted action=group (e.g. edit=sysop)',
'expiry' => array( 'Expiry timestamps. If only one timestamp is set, it\'ll be used for all protections.',
- 'Use \'infinite\', \'indefinite\' or \'never\', for a neverexpiring protection.' ),
+ 'Use \'infinite\', \'indefinite\' or \'never\', for a never-expiring protection.' ),
'reason' => 'Reason for (un)protecting',
'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)',
'Ignored if not all protection levels are \'sysop\' or \'protect\'' ),
@@ -234,8 +229,4 @@ class ApiProtect extends ApiBase {
public function getHelpUrls() {
return 'https://www.mediawiki.org/wiki/API:Protect';
}
-
- public function getVersion() {
- return __CLASS__ . ': $Id$';
- }
}