mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:35:12 +00:00
remove period from characters allowed in username, as this will mess up URL based content-type negotiation. It was previously disallowed but permitted a month or two ago after seeing Diaspora started allowing it. It's OK if they have it, but we can't; as many of our urls are based on username and theirs are primarily based on uid.
This commit is contained in:
parent
d58f965b9a
commit
842a041a88
2 changed files with 6 additions and 6 deletions
|
@ -52,7 +52,7 @@ function identity_check_service_class($account_id) {
|
||||||
*
|
*
|
||||||
* This action is pluggable.
|
* This action is pluggable.
|
||||||
* We're currently only checking for an empty name or one that exceeds our
|
* We're currently only checking for an empty name or one that exceeds our
|
||||||
* storage limit (255 chars). 255 chars is probably going to create a mess on
|
* storage limit (191 chars). 191 chars is probably going to create a mess on
|
||||||
* some pages.
|
* some pages.
|
||||||
* Plugins can set additional policies such as full name requirements, character
|
* Plugins can set additional policies such as full name requirements, character
|
||||||
* sets, multi-byte length, etc.
|
* sets, multi-byte length, etc.
|
||||||
|
@ -67,7 +67,7 @@ function validate_channelname($name) {
|
||||||
if (! $name)
|
if (! $name)
|
||||||
return t('Empty name');
|
return t('Empty name');
|
||||||
|
|
||||||
if (strlen($name) > 255)
|
if (mb_strlen($name) > 191)
|
||||||
return t('Name too long');
|
return t('Name too long');
|
||||||
|
|
||||||
$arr = ['name' => $name];
|
$arr = ['name' => $name];
|
||||||
|
|
|
@ -1984,14 +1984,14 @@ function is_a_date_arg($s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function legal_webbie($s) {
|
function legal_webbie($s) {
|
||||||
if(! strlen($s))
|
if(! $s)
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
// WARNING: This regex will not work in a federated environment.
|
// WARNING: This regex may not work in a federated environment.
|
||||||
// You will probably want something like
|
// You will probably want something like
|
||||||
// preg_replace('/([^a-z0-9\_])/','',strtolower($s));
|
// preg_replace('/([^a-z0-9\_])/','',strtolower($s));
|
||||||
|
|
||||||
$r = preg_replace('/([^a-z0-9\-\_\.])/','',strtolower($s));
|
$r = preg_replace('/([^a-z0-9\-\_])/','',strtolower($s));
|
||||||
|
|
||||||
$x = [ 'input' => $s, 'output' => $r ];
|
$x = [ 'input' => $s, 'output' => $r ];
|
||||||
call_hooks('legal_webbie',$x);
|
call_hooks('legal_webbie',$x);
|
||||||
|
@ -2003,7 +2003,7 @@ function legal_webbie_text() {
|
||||||
|
|
||||||
// WARNING: This will not work in a federated environment.
|
// WARNING: This will not work in a federated environment.
|
||||||
|
|
||||||
$s = t('a-z, 0-9, -, _, and . only');
|
$s = t('a-z, 0-9, -, and _ only');
|
||||||
|
|
||||||
$x = [ 'text' => $s ];
|
$x = [ 'text' => $s ];
|
||||||
call_hooks('legal_webbie_text',$x);
|
call_hooks('legal_webbie_text',$x);
|
||||||
|
|
Loading…
Reference in a new issue