Page MenuHomePhabricator

Inconsistent Title validation in File & FileRepo
Closed, ResolvedPublic


Found while investigating bug 32031 -- a lot of File & FileRepo functions accept either a string or a Title object as a reference, normalizing strings to titles with forced NS_FILE and aborting if it's an invalid title object.

However a) this code is duplicated in many functions and b) few or none of them seem to validate a Title object that gets passed in. As a result some things seem to sorta work with Media: or other namespaces but somewhere along the line something breaks.

Should probably have a common input validation function for these methods to use, which will:

  • do the string to title conversion
  • discard invalid title objects
  • normalize NS_MEDIA to NS_FILE
  • discard title objects in non-file namespaces

Version: 1.20.x
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:00 AM
bzimport set Reference to bz32195.
bzimport added a subscriber: Unknown Object (MLST).
brion created this task.Nov 4 2011, 12:08 AM
aaron added a comment.Nov 8 2011, 2:12 AM

Done in r102073.

Gilles triaged this task as Unbreak Now! priority.Dec 4 2014, 10:10 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Needs Triage.Dec 4 2014, 11:22 AM