Page MenuHomePhabricator

Ensure that SpamBlacklist applies to the content of all MCR slots
Closed, ResolvedPublic

Description

Split from parent for sanity

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Jdforrester-WMF created this task.
Jdforrester-WMF renamed this task from Ensure that SpamBlacklist applies to content of all slots to Ensure that SpamBlacklist applies to the content of all MCR slots.Nov 5 2018, 7:43 PM
CCicalese_WMF added a subscriber: tstarling.
daniel claimed this task.

Analysis: SpamBlacklists uses the EditFilterMergedContent hook, to which it binds the handle function SpamBlacklistHooks::filterMergedContent.
In that method, it calls WikiPage::prepareContentForEdit which returns an EditInfo instances with a ParserOutput object in the $output field. This object comes from DerivedPageDataUpdater::getPreparedEdit, which sets the $output field to the combined ParserOutput for all slots as returned by getCanonicalParserOutput(). SpamBlacklistHooks::filterMergedContent() then calls getExternalLinks() on that ParserOutput, and applies the blacklist filter to it.

Since the filter is applied to the combined ParserOutput for all slots, the blacklist will "just work" with MCR.

Caveat: For file uploeads, the UploadVerifyUpload filter is used instead, handled by SpamBlacklistHooks::onUploadVerifyUpload. The page text associated with the upload is passed in as a string and interpreted as Wikitext. This will have to be changed one uploads can have multi-slot content associated with them immediately.

Closing as resolved.