Merge "Language: s/error_log/wfWarn/"
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisions.php
index 3ff6805..da4ec19 100644 (file)
@@ -48,6 +48,7 @@ class ApiQueryRevisions extends ApiQueryBase {
 
        private $tokenFunctions;
 
+       /** @deprecated since 1.24 */
        protected function getTokenFunctions() {
                // tokenname => function
                // function prototype is func($pageid, $title, $rev)
@@ -72,6 +73,7 @@ class ApiQueryRevisions extends ApiQueryBase {
        }
 
        /**
+        * @deprecated since 1.24
         * @param int $pageid
         * @param Title $title
         * @param Revision $rev
@@ -318,7 +320,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                                // Paranoia: avoid brute force searches (bug 17342)
                                if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) {
                                        $bitmask = Revision::DELETED_USER;
-                               } elseif ( !$this->getUser()->isAllowed( 'suppressrevision' ) ) {
+                               } elseif ( !$this->getUser()->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
                                        $bitmask = Revision::DELETED_USER | Revision::DELETED_RESTRICTED;
                                } else {
                                        $bitmask = 0;
@@ -748,6 +750,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                        'parse' => false,
                        'section' => null,
                        'token' => array(
+                               ApiBase::PARAM_DEPRECATED => true,
                                ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
                                ApiBase::PARAM_ISMULTI => true
                        ),
@@ -807,70 +810,6 @@ class ApiQueryRevisions extends ApiQueryBase {
                );
        }
 
-       public function getResultProperties() {
-               $props = array(
-                       '' => array(),
-                       'ids' => array(
-                               'revid' => 'integer',
-                               'parentid' => array(
-                                       ApiBase::PROP_TYPE => 'integer',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'flags' => array(
-                               'minor' => 'boolean'
-                       ),
-                       'user' => array(
-                               'userhidden' => 'boolean',
-                               'user' => 'string',
-                               'anon' => 'boolean'
-                       ),
-                       'userid' => array(
-                               'userhidden' => 'boolean',
-                               'userid' => 'integer',
-                               'anon' => 'boolean'
-                       ),
-                       'timestamp' => array(
-                               'timestamp' => 'timestamp'
-                       ),
-                       'size' => array(
-                               'size' => 'integer'
-                       ),
-                       'sha1' => array(
-                               'sha1' => 'string'
-                       ),
-                       'comment' => array(
-                               'commenthidden' => 'boolean',
-                               'comment' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'parsedcomment' => array(
-                               'commenthidden' => 'boolean',
-                               'parsedcomment' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'content' => array(
-                               '*' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               ),
-                               'texthidden' => 'boolean',
-                               'textmissing' => 'boolean',
-                       ),
-                       'contentmodel' => array(
-                               'contentmodel' => 'string'
-                       ),
-               );
-
-               self::addTokenProperties( $props, $this->getTokenFunctions() );
-
-               return $props;
-       }
-
        public function getDescription() {
                return array(
                        'Get revision information.',
@@ -882,33 +821,6 @@ class ApiQueryRevisions extends ApiQueryBase {
                );
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(), array(
-                       array( 'nosuchrevid', 'diffto' ),
-                       array(
-                               'code' => 'revids',
-                               'info' => 'The revids= parameter may not be used with the list options '
-                                       . '(limit, startid, endid, dirNewer, start, end).'
-                       ),
-                       array(
-                               'code' => 'multpages',
-                               'info' => 'titles, pageids or a generator was used to supply multiple pages, '
-                                       . ' but the limit, startid, endid, dirNewer, user, excludeuser, '
-                                       . 'start and end parameters may only be used on a single page.'
-                       ),
-                       array(
-                               'code' => 'diffto',
-                               'info' => 'rvdiffto must be set to a non-negative number, "prev", "next" or "cur"'
-                       ),
-                       array( 'code' => 'badparams', 'info' => 'start and startid cannot be used together' ),
-                       array( 'code' => 'badparams', 'info' => 'end and endid cannot be used together' ),
-                       array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together' ),
-                       array( 'code' => 'nosuchsection', 'info' => 'There is no section section in rID' ),
-                       array( 'code' => 'badformat', 'info' => 'The requested serialization format can not be applied '
-                               . ' to the page\'s content model' ),
-               ) );
-       }
-
        public function getExamples() {
                return array(
                        'Get data with content for the last revision of titles "API" and "Main Page"',