Page MenuHomePhabricator

Protected function UploadBase->validateName should be public
Closed, ResolvedPublic

Description

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.


Version: 1.20.x
Severity: enhancement

Details

Reference
bz38221

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:59 AM
bzimport set Reference to bz38221.
cneubauer created this task.Jul 6 2012, 6:48 PM

rahul14m93 wrote:

Gerrit Change #56672

rahul14m93 wrote:

What do you mean by external classes?can you highlight some classes

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.

(In reply to comment #1)

Change-Id: Ie6c3f95a09ef84777313c3ec2edd31c50c397e28

Merged.

Gilles moved this task from Untriaged to Done on the Multimedia board.