Last modified: 2010-11-10 09:17:21 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 T27670, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25670 - wfFindFile should check namespace of given title
wfFindFile should check namespace of given title
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-27 13:18 UTC by Umherirrender
Modified: 2010-11-10 09:17 UTC (History)
4 users (show)

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


Attachments

Description Umherirrender 2010-10-27 13:18:49 UTC
When give a Title object to wfFindFile the namespace is not check. It is possible to put in a Tilte with "Project:Wiki.png" and the function give the file "Wiki.png" back.

In my opinion it is better to check the namespace of the given title against NS_FILE. Thanks.
Comment 1 Derk-Jan Hartman 2010-10-27 18:55:02 UTC
wfFindFile() triggers findFile() in FileRepo.php and RepoGroup.php...

It is indeed true that atm, the File namespace is not enforced... I'm not sure what the best place is to enforce this atm.

Perhaps in newFile() of FileRepo.php ? We have to account for NS_MEDIA as well btw.
Comment 2 Alexandre Emsenhuber [IAlex] 2010-11-10 09:17:21 UTC
Done in r76437.

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


Navigation
Links