X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryRevisions.php;h=881b79721bfcf39057adb2015b456caa75b645ec;hb=5e2ac408f888043b3c62a42b5c9c9ece5ddaf419;hp=3590093f1910bb6883ef717da2fca9971b9547e2;hpb=53ffc462212e1ecbc62041d68b8e15d29f5aa659;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 3590093f19..881b79721b 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -196,8 +196,9 @@ class ApiQueryRevisions extends ApiQueryBase { if ( isset( $prop['content'] ) || !is_null( $this->difftotext ) ) { // For each page we will request, the user must have read rights for that page + $user = $this->getUser(); foreach ( $pageSet->getGoodTitles() as $title ) { - if ( !$title->userCan( 'read' ) ) { + if ( !$title->userCan( 'read', $user ) ) { $this->dieUsage( 'The current user is not allowed to read ' . $title->getPrefixedText(), 'accessdenied' ); @@ -539,7 +540,7 @@ class ApiQueryRevisions extends ApiQueryBase { } } if ( $this->parseContent ) { - $po = $content->getParserOutput( $title, ParserOptions::newFromContext( $this->getContext() ) ); + $po = $content->getParserOutput( $title, $revision->getId(), ParserOptions::newFromContext( $this->getContext() ) ); $text = $po->getText(); } @@ -612,7 +613,7 @@ class ApiQueryRevisions extends ApiQueryBase { return 'private'; } if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) { - // formatComment() calls wfMsg() among other things + // formatComment() calls wfMessage() among other things return 'anon-public-user-private'; } return 'public'; @@ -804,10 +805,10 @@ class ApiQueryRevisions extends ApiQueryBase { 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).' ), + . '(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.' ), + . ' 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' ),