X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiProtect.php;h=a3d12b7fc061c3a8da938e4e84ed390f024d84bb;hb=1cc3c9a9e0d37621da23b3c45c61063d43493c9b;hp=828fc22ab2c678e89ef272408feabcf1da3b35fe;hpb=c54bcbc5b91d04908892b9c7e5a23393b9c7a3b8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index 828fc22ab2..a3d12b7fc0 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -102,6 +102,9 @@ class ApiProtect extends ApiBase { $cascade = $params['cascade']; + if ( $params['watch'] ) { + $this->logFeatureUsage( 'action=protect&watch' ); + } $watch = $params['watch'] ? 'watch' : $params['watchlist']; $this->setWatch( $watch, $titleObj, 'watchdefault' ); @@ -145,10 +148,6 @@ class ApiProtect extends ApiBase { 'pageid' => array( ApiBase::PARAM_TYPE => 'integer', ), - 'token' => array( - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true - ), 'protections' => array( ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_REQUIRED => true, @@ -182,7 +181,6 @@ class ApiProtect extends ApiBase { return array( 'title' => "Title of the page you want to (un)protect. Cannot be used together with {$p}pageid", 'pageid' => "ID of the page you want to (un)protect. Cannot be used together with {$p}title", - '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 ' . @@ -205,11 +203,7 @@ class ApiProtect extends ApiBase { } public function needsToken() { - return true; - } - - public function getTokenSalt() { - return ''; + return 'csrf'; } public function getExamples() {