Last modified: 2013-04-05 21:12:45 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 T40221, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38221 - Protected function UploadBase->validateName should be public
Protected function UploadBase->validateName should be public
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.20.x
All All
: Low enhancement (vote)
: 1.22.0 release
Assigned To: Mark Holmquist
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-06 18:48 UTC by Christian Neubauer
Modified: 2013-04-05 21:12 UTC (History)
3 users (show)

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


Attachments

Description Christian Neubauer 2012-07-06 18:48:32 UTC
When uploading a file using the UploadBase.php class, the getTitle() function will return the title of the uploaded file or null if the title is invalid for some reason. However, to figure out why the title is invalid, you have to access the member variable mTitleError or call the function validateName(). Both are protected though so they can't be called by external classes.

The easiest fix would be to make validateName() public instead of protected.
Comment 1 Rahul Maliakkal 2013-03-29 20:53:23 UTC
Gerrit change #56672
Comment 2 Rahul Maliakkal 2013-04-04 14:59:52 UTC
What do you mean by external classes?can you highlight some classes
Comment 3 Christian Neubauer 2013-04-04 19:08:42 UTC
I mean any class that is not part of the UploadBase class (so it can't call protected functions or members on an UploadBase object). If you, for example, build an extension that uses an UploadBase instance, there is no way to get the title validation error.
Comment 4 Krinkle 2013-04-05 21:12:45 UTC
(In reply to comment #1)
> Change-Id: Ie6c3f95a09ef84777313c3ec2edd31c50c397e28

Merged.

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


Navigation
Links