Page MenuHomePhabricator

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


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



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:59 AM
bzimport set Reference to bz38221.

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