mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +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();
|
$store = MediaWikiServices::getInstance()->getRevisionStore();
|
||||||
$prevRevision = $store->getRevisionById( $revision->getParentId() );
|
$prevRevision = $store->getRevisionById( $revision->getParentId() );
|
||||||
if ( $prevRevision ) {
|
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(
|
$changes = self::getMachineReadableDiff(
|
||||||
$prevText,
|
$prevText,
|
||||||
ContentHandler::getContentText( $revision->getContent( SlotRecord::MAIN ) )
|
( $content instanceof TextContent ) ? $content->getText() : null
|
||||||
);
|
);
|
||||||
$output = self::interpretDiff(
|
$output = self::interpretDiff(
|
||||||
$changes,
|
$changes,
|
||||||
|
|
|
@ -34,7 +34,9 @@ class EchoOnWikiList implements EchoContainmentList {
|
||||||
if ( $article === null || !$article->exists() ) {
|
if ( $article === null || !$article->exists() ) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
$text = ContentHandler::getContentText( $article->getContent() );
|
|
||||||
|
$content = $article->getContent();
|
||||||
|
$text = ( $content instanceof TextContent ) ? $content->getText() : null;
|
||||||
if ( $text === null ) {
|
if ( $text === null ) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue