[MediaWiki-l] Why are usernames force Ucfirst?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] Why are usernames force Ucfirst?

Otheus (aka Timothy J. Shelling)
Greetings,

Several people over the last 12+ years have asked -- and not been given an
answer -- why usernames' first character are forced to upper-case. I now
have the same question. The discussion stems from this talk pages:
https://www.mediawiki.org/wiki/Manual_talk:$wgCapitalLinks and
https://www.mediawiki.org/wiki/Manual_talk:$wgCapitalLinkOverrides

To me, this looks like an obsolete, legacy requirement from long before the
time $wgCapitalLinks was introduced.
The relevant code is found in includes/user/User.php:

        public static function getCanonicalName( $name, $validate = 'valid'
) {
                // Force usernames to capital
                global $wgContLang;
                $name = $wgContLang->ucfirst( $name );

isValidUserName also checks this condition. But no where do I see *why*.

Proposal:

It seems to me that either $wgCapitalLinks should apply here, or (for
backward compatibility), a new option ( $wgCapitalNames ) should be created
to allow the site-admin to disable the forcing of ucfirst of usernames.


--
Otheus
[hidden email]
+43.699.1049.7813
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Why are usernames force Ucfirst?

Bartosz Dziewoński
There is no good reason. But now it's scary to change it, since there could
be places where we assume that usernames can not begin with a lowercase
letter. There is task https://phabricator.wikimedia.org/T28396 about this.
Although folks are complaining about it, it seems that no one has proposed
a patch. (As long as the default is still to user capitalized usernames, I
don't see why we couldn't have an option to allow lowercase ones.)

For example, one case where we assume usernames can't be lowercase is in
some "shortcut" URLs for special pages. URLs like
https://en.wikipedia.org/wiki/Special:Contributions/Matma_Rex and
https://en.wikipedia.org/wiki/Special:Log/Matma_Rex will display the
edits/logs of an account, but URLs like
https://en.wikipedia.org/wiki/Special:Contributions/newbies and
https://en.wikipedia.org/wiki/Special:Log/block have special meaning (and
the edits/logs of a user named "newbies" or "block" couldn't be accessed
like this). In this case it's harmless (you could still access them using
the form), but there might be assumptions like this in more important
places.

--
Matma Rex
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l