Page MenuHomePhabricator

Create a way to consistently validate titles (dbKeys) for use in the database.
Open, Needs TriagePublic

Description

TitleParser can parse and validate user input and turn it into a LinkTarget. We need a similar mechanism for creating known valid instances of PageReference and PageIdentity from user input.

Perhaps we also need a mechanism for creating PageReference and PageIdentity instances from semi-trusted input such as the database or imports, similar to TitleValue::tryNew.

Alternative to explore: allow invalid PageReferences and PageIdentites and PageRecord, but require a ValidatedPageReference when writing to the DB. Validation occurs when converting from on to the other. But do we really want to introduce the extra types? Shall we add an isValidated() flag? That grows the constructor...

Details

Related Changes in Gerrit:

Event Timeline

Change 685749 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] WIP: put back validation of PageReferences

https://gerrit.wikimedia.org/r/685749

@daniel: Per emails from Sep18 and Oct20 and https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup , I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!