?

Log in

No account? Create an account
dah dah dah - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

dah dah dah [Feb. 3rd, 2003|03:05 pm]
LiveJournal Client Discussions
lj_clients
[idiequietly]
just curious as to what limitations to user names and passwords are.

such as characters allowed and rules (ie, cant start or end with a underscore but can have underscores in the string)

thanks &&daniel
linkReply

Comments:
[User Picture]From: erebrandir
2003-02-03 06:06 pm (UTC)

From livejournal/cgi-bin/ljlib.pl:

# <LJFUNC>
# name: LJ::canonical_username
# des:
# info:
# args: user
# returns: the canonical username given, or blank if the username is not well-formed
# </LJFUNC>
sub canonical_username
{
    my $user = shift;
    if ($user =~ /^\s*([\w\-]{1,15})\s*$/) {
        $user = lc($1);
        $user =~ s/-/_/g;
        return $user;
    }
    return "";  # not a good username.
}

In other words, it can take [a-z0-9_], with no default restrictions. There are, however, reserved usernames, which are configurable, and differ from installation to installation. I don't know what all of them are on LJ, but the defaults are (from ljconfig.pl):

# list of regular expressions matching usernames that people can't have.
@PROTECTED_USERNAMES = ("^ex_", "^lj_");

In other words, it can't begin with "ex_" or "lj_".

(Reply) (Thread)