(bug 30836) API siteinfo specialpagealiases should not return nonexistent special...
[lhc/web/wiklou.git] / includes / api / ApiPatrol.php
index 2adc9a6..45d19d0 100644 (file)
  * @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 ) );
@@ -86,6 +80,16 @@ class ApiPatrol extends ApiBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               'rcid' => 'integer',
+                               'ns' => 'namespace',
+                               'title' => 'string'
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'Patrol a page or revision';
        }
@@ -111,7 +115,7 @@ class ApiPatrol extends ApiBase {
        }
 
        public function getHelpUrls() {
-               return 'http://www.mediawiki.org/wiki/API:Patrol';
+               return 'https://www.mediawiki.org/wiki/API:Patrol';
        }
 
        public function getVersion() {