Use WikiPage::prepareContentForEdit in SpamBlacklistHooks::filterMergedContent

Using WikiPage::prepareContentForEdit instead of
Content::getParserOutput allows us to share the cached parser output
with other hooks that run during the edit process.

Note SpamBlacklistHooks::filterAPIEditBeforeSave already does this.

Bug: 57026
Change-Id: I8c8b293af2842411fd95d3bc21e966a72b2a78b4
This commit is contained in:
Brad Jorsch 2013-12-14 10:21:47 -05:00
parent d709540dbd
commit 508a3706d6

View file

@ -25,7 +25,8 @@ class SpamBlacklistHooks {
}
// get the link from the not-yet-saved page content.
$pout = $content->getParserOutput( $title );
$editInfo = $context->getWikiPage()->prepareContentForEdit( $content );
$pout = $editInfo->output;
$links = array_keys( $pout->getExternalLinks() );
// HACK: treat the edit summary as a link