Merge pull request #1802 from annando/1508-valid-username

On OStatus and Diaspora the usernames mustn't contain "-"

I don't like it, but if GNU Social and Diaspora have this limitation...
2022.09-rc
Tobias Diekershoff 2015-08-10 08:49:56 +02:00
commit c076c56016
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -136,8 +136,8 @@ function create_user($arr) {
$nickname = $arr['nickname'] = strtolower($nickname);
if(! preg_match("/^[a-z][a-z0-9\-\_]*$/",$nickname))
$result['message'] .= t('Your "nickname" can only contain "a-z", "0-9", "-", and "_", and must also begin with a letter.') . EOL;
if(! preg_match("/^[a-z0-9][a-z0-9\_]*$/",$nickname))
$result['message'] .= t('Your "nickname" can only contain "a-z", "0-9" and "_".') . EOL;
$r = q("SELECT `uid` FROM `user`
WHERE `nickname` = '%s' LIMIT 1",
dbesc($nickname)