provide a global way of enforcing name policy restrictions, but only enforce empty names or length > storage size. Allow plugins to set other policies. In particular, you can't have an empty channel name now, but one char is legal ;-)

This commit is contained in:
friendica
2013-02-07 18:53:51 -08:00
parent bf4b964aeb
commit 82ed07baa1
2 changed files with 31 additions and 4 deletions

View File

@@ -429,10 +429,12 @@ function settings_post(&$a) {
if($username != $channel['channel_name']) {
$name_change = true;
if(mb_strlen($username) > 40)
$err .= t(' Please use a shorter name.');
if(mb_strlen($username) < 3)
$err .= t(' Name too short.');
require_once('include/identity.php');
$err = validate_channelname($username);
if($err) {
notice($err);
return;
}
}