mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 15:36:58 +00:00
Merge "Avoid using ContentHandler::getContentText()"
This commit is contained in:
commit
98d7428837
|
@ -517,13 +517,15 @@ abstract class EchoDiscussionParser {
|
|||
$store = MediaWikiServices::getInstance()->getRevisionStore();
|
||||
$prevRevision = $store->getRevisionById( $revision->getParentId() );
|
||||
if ( $prevRevision ) {
|
||||
$prevText = ContentHandler::getContentText( $prevRevision->getContent( SlotRecord::MAIN ) ) ?: '';
|
||||
$prevContent = $prevRevision->getContent( SlotRecord::MAIN );
|
||||
$prevText = ( $prevContent instanceof TextContent ) ? $prevContent->getText() : '';
|
||||
}
|
||||
}
|
||||
|
||||
$content = $revision->getContent( SlotRecord::MAIN );
|
||||
$changes = self::getMachineReadableDiff(
|
||||
$prevText,
|
||||
ContentHandler::getContentText( $revision->getContent( SlotRecord::MAIN ) )
|
||||
( $content instanceof TextContent ) ? $content->getText() : null
|
||||
);
|
||||
$output = self::interpretDiff(
|
||||
$changes,
|
||||
|
|
|
@ -34,7 +34,9 @@ class EchoOnWikiList implements EchoContainmentList {
|
|||
if ( $article === null || !$article->exists() ) {
|
||||
return [];
|
||||
}
|
||||
$text = ContentHandler::getContentText( $article->getContent() );
|
||||
|
||||
$content = $article->getContent();
|
||||
$text = ( $content instanceof TextContent ) ? $content->getText() : null;
|
||||
if ( $text === null ) {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue