Last modified: 2011-11-08 02:12:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34195, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32195 - Inconsistent Title validation in File & FileRepo
Inconsistent Title validation in File & FileRepo
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.20.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 32031
  Show dependency treegraph
 
Reported: 2011-11-04 00:08 UTC by Brion Vibber
Modified: 2011-11-08 02:12 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2011-11-04 00:08:03 UTC
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
Comment 1 Aaron Schulz 2011-11-08 02:12:12 UTC
Done in r102073.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links