Page MenuHomePhabricator

`upload_by_url` user right should be `upload-by-url`
Open, Needs TriagePublic

Description

It looks like upload_by_url is the only user right which uses underscores rather than dashes in it's name. It should probably be renamed to upload-by-url to follow the standard.

Event Timeline

Would this also apply to right-upload_by_url and action-upload_by_url in MediaWiki core?

Would this break [some] extensions using it?

$:acko\> grep -r upload_by_url .
./BlueSpiceExtensions/WikiAdmin/WikiAdmin.class.php:		'upload_by_url',
./PollNY/includes/upload/PollAjaxUploadForm.class.php:		$canUploadByUrl = UploadFromUrl::isEnabled() && $this->getUser()->isAllowed( 'upload_by_url' );
./UserGroups/UserRights.php:		'upload_by_url',
./PageForms/specials/PF_UploadForm.php:		$canUploadByUrl = UploadFromUrl::isEnabled() && $this->getUser()->isAllowed( 'upload_by_url' );
./PictureGame/includes/upload/PictureGameAjaxUploadForm.class.php:		$canUploadByUrl = UploadFromUrl::isEnabled() && $this->getUser()->isAllowed( 'upload_by_url' );
./QuizGame/includes/upload/QuestionGameUploadForm.class.php:		$canUploadByUrl = UploadFromUrl::isEnabled() && $this->getUser()->isAllowed( 'upload_by_url' );
./FanBoxes/includes/upload/FanBoxAjaxUploadForm.class.php:		$canUploadByUrl = UploadFromUrl::isEnabled() && $this->getUser()->isAllowed( 'upload_by_url' );
./GWToolset/GWToolset.php:$wgGroupPermissions["gwtoolset"]["upload_by_url"] = true;

Would this also apply to right-upload_by_url and action-upload_by_url in MediaWiki core?
[...]

Yes, because the messages are directly derived of the right. MediaWiki core determines the message by prepending right- and action- to the name of the right.

[...]
Would this break [some] extensions using it?
[...]

Not unless wikis decide to immediately switch to the new name before the extensions have been updated to use the new name.
Though the gwtoolset group will not show the correct description on Special:ListGroupRights and UserGroups will not be able to assign the upload-by-url right until it has been renamed. Neither is breaking though.

To clarify using underscore as a space replacement does not seen to be illegal per the MediaWiki manual. It is just that this is the only case I have found which doesn't use dashes.

It would break all extensions not in gerrit that use it (we would probably update the ones in gerrit), it would break all sites which add this right somewhere in the config (LocalSettings etc), it would break custom localisation (not a big deal). I don't think this should be attempted without a deprecation period, which means some kind of alias mechanism.