I'm trying to create a MediaWiki extension that would compare content of a page before and after saving an edit. I figured out MultiContentSave hook would be the proper one to use. Inside I can get edited page content using following code:
class MyExtensionHooks {
public static function onMultiContentSave(
RenderedRevision $renderedRevision,
UserIdentity $user,
CommentStoreComment $summary,
$flags,
Status $hookStatus
) {
$revision = $renderedRevision->getRevision();
$title = $revision->getPageAsLinkTarget();
$new_content = $revision->getContent(SlotRecord::MAIN, RevisionRecord::RAW)->getNativeData();
// ...
return true;
}
}
How can I access content of the page before the edit?