dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Provide command to adjust phpunit.xml for code coverage"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiParse.php
diff --git
a/includes/api/ApiParse.php
b/includes/api/ApiParse.php
index
84fff96
..
40edafa
100644
(file)
--- a/
includes/api/ApiParse.php
+++ b/
includes/api/ApiParse.php
@@
-21,6
+21,7
@@
*/
use MediaWiki\MediaWikiServices;
*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
/**
* @ingroup API
/**
* @ingroup API
@@
-105,7
+106,7
@@
class ApiParse extends ApiBase {
}
$this->checkTitleUserPermissions( $rev->getTitle(), 'read' );
}
$this->checkTitleUserPermissions( $rev->getTitle(), 'read' );
- if ( !$rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) {
+ if ( !$rev->userCan( Revision
Record
::DELETED_TEXT, $this->getUser() ) ) {
$this->dieWithError(
[ 'apierror-permissiondenied', $this->msg( 'action-deletedtext' ) ]
);
$this->dieWithError(
[ 'apierror-permissiondenied', $this->msg( 'action-deletedtext' ) ]
);
@@
-490,6
+491,7
@@
class ApiParse extends ApiBase {
$parser = MediaWikiServices::getInstance()->getParser();
$parser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
$parser = MediaWikiServices::getInstance()->getParser();
$parser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
+ // @phan-suppress-next-line PhanUndeclaredMethod
$xml = $parser->preprocessToDom( $this->content->getText() )->__toString();
$result_array['parsetree'] = $xml;
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree';
$xml = $parser->preprocessToDom( $this->content->getText() )->__toString();
$result_array['parsetree'] = $xml;
$result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree';
@@
-562,23
+564,23
@@
class ApiParse extends ApiBase {
WikiPage $page, $popts, $suppressCache, $pageId, $rev, $getContent
) {
$revId = $rev ? $rev->getId() : null;
WikiPage $page, $popts, $suppressCache, $pageId, $rev, $getContent
) {
$revId = $rev ? $rev->getId() : null;
- $isDeleted = $rev && $rev->isDeleted( Revision::DELETED_TEXT );
+ $isDeleted = $rev && $rev->isDeleted( Revision
Record
::DELETED_TEXT );
if ( $getContent || $this->section !== false || $isDeleted ) {
if ( $rev ) {
if ( $getContent || $this->section !== false || $isDeleted ) {
if ( $rev ) {
- $this->content = $rev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
+ $this->content = $rev->getContent( Revision
Record
::FOR_THIS_USER, $this->getUser() );
if ( !$this->content ) {
$this->dieWithError( [ 'apierror-missingcontent-revid', $revId ] );
}
} else {
if ( !$this->content ) {
$this->dieWithError( [ 'apierror-missingcontent-revid', $revId ] );
}
} else {
- $this->content = $page->getContent( Revision::FOR_THIS_USER, $this->getUser() );
+ $this->content = $page->getContent( Revision
Record
::FOR_THIS_USER, $this->getUser() );
if ( !$this->content ) {
$this->dieWithError( [ 'apierror-missingcontent-pageid', $page->getId() ] );
}
}
$this->contentIsDeleted = $isDeleted;
$this->contentIsSuppressed = $rev &&
if ( !$this->content ) {
$this->dieWithError( [ 'apierror-missingcontent-pageid', $page->getId() ] );
}
}
$this->contentIsDeleted = $isDeleted;
$this->contentIsSuppressed = $rev &&
- $rev->isDeleted( Revision
::DELETED_TEXT | Revision
::DELETED_RESTRICTED );
+ $rev->isDeleted( Revision
Record::DELETED_TEXT | RevisionRecord
::DELETED_RESTRICTED );
}
if ( $this->section !== false ) {
}
if ( $this->section !== false ) {