Page MenuHomePhabricator

Move Sanitizer from core into Parsoid
Open, MediumPublic

Description

We have two copies of the Sanitizer class: one in mediawiki core and one in Parsoid.

We should move the core Sanitizer into Parsoid, and then merge its functionality with Parsoid.

Related Objects

Event Timeline

cscott created this task.Mar 17 2020, 2:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 17 2020, 2:50 AM
ssastry triaged this task as Medium priority.Mar 17 2020, 4:28 PM
ssastry moved this task from Needs Triage to Tech Debt / Big changes on the Parsoid board.

My idea is to first move the code w/ no changes from core to Wikimedia\Parsoid\Sanitizer\Sanitizer.php, tag & deploy that (bump the composer version), then hollow out the core version so that it only consists of deprecated proxies for the parsoid versions.

Then we can over time merge the Parsoid and core implementations, working inside the Parsoid repo.

My idea is to first move the code w/ no changes from core to Wikimedia\Parsoid\Sanitizer\Sanitizer.php,

Should it be Wikimedia\Parsoid\Core\Sanitizer.php though? Or, if we think it belongs in the root namespace, Wikimedia\Parsoid\Sanitzer.php ... are we expecting more sanitization classes to create a Sanitizer/ namespace?