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 triaged this task as Normal priority.
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.
CCicalese_WMF removed tstarling as the assignee of this task.Nov 5 2018, 10:38 PM
CCicalese_WMF added a subscriber: tstarling.
daniel closed this task as Resolved.Nov 6 2018, 1:42 PM
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.

greg added a project: Multimedia.Mar 7 2019, 10:59 PM