X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiQueryRevisions.php;h=627de556231753e04cec577553bd564077802ad9;hb=3191c5cc7e1e97764159e4ea3b594db02373e01d;hp=50c3c7b6b0a3af0863912f85b44aea3ecb008b0c;hpb=2664c2ab0168a0eec21db72532b3dc2c05468912;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 50c3c7b6b0..627de55623 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -318,7 +318,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; @@ -624,10 +624,9 @@ class ApiQueryRevisions extends ApiQueryBase { } if ( $content && ( !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) ) { - global $wgAPIMaxUncachedDiffs; static $n = 0; // Number of uncached diffs we've had - if ( $n < $wgAPIMaxUncachedDiffs ) { + if ( $n < $this->getConfig()->get( 'APIMaxUncachedDiffs' ) ) { $vals['diff'] = array(); $context = new DerivativeContext( $this->getContext() ); $context->setTitle( $title ); @@ -808,70 +807,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.', @@ -883,33 +818,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"',