summaryrefslogtreecommitdiff
path: root/includes/api/ApiPatrol.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiPatrol.php')
-rw-r--r--includes/api/ApiPatrol.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php
index 8e6e8738..1332f263 100644
--- a/includes/api/ApiPatrol.php
+++ b/includes/api/ApiPatrol.php
@@ -24,10 +24,6 @@
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- require_once ( 'ApiBase.php' );
-}
-
/**
* Allows user to patrol pages
* @ingroup API
@@ -42,15 +38,13 @@ class ApiPatrol extends ApiBase {
* Patrols the article or provides the reason the patrol failed.
*/
public function execute() {
- global $wgUser;
-
$params = $this->extractRequestParams();
$rc = RecentChange::newFromID( $params['rcid'] );
if ( !$rc instanceof RecentChange ) {
$this->dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) );
}
- $retval = $rc->doMarkPatrolled( $wgUser );
+ $retval = $rc->doMarkPatrolled( $this->getUser() );
if ( $retval ) {
$this->dieUsageMsg( reset( $retval ) );
@@ -104,7 +98,7 @@ class ApiPatrol extends ApiBase {
return 'patrol';
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'api.php?action=patrol&token=123abc&rcid=230672766'
);