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