forked from GNUsocial/gnu-social
Use NICKNAME_FMT everywhere consistently
This commit is contained in:
parent
c3a522623c
commit
83ff1cecd3
@ -217,7 +217,7 @@ class FinishopenidloginAction extends Action
|
|||||||
|
|
||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -389,7 +389,7 @@ class FinishopenidloginAction extends Action
|
|||||||
{
|
{
|
||||||
if (!Validate::string($str, array('min_length' => 1,
|
if (!Validate::string($str, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!User::allowed_nickname($str)) {
|
if (!User::allowed_nickname($str)) {
|
||||||
|
@ -189,7 +189,7 @@ class ProfilesettingsAction extends AccountSettingsAction
|
|||||||
// Some validation
|
// Some validation
|
||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||||
return;
|
return;
|
||||||
} else if (!User::allowed_nickname($nickname)) {
|
} else if (!User::allowed_nickname($nickname)) {
|
||||||
|
@ -79,7 +79,7 @@ class UpdateprofileAction extends Action
|
|||||||
$nickname = $req->get_parameter('omb_listenee_nickname');
|
$nickname = $req->get_parameter('omb_listenee_nickname');
|
||||||
if ($nickname && !Validate::string($nickname, array('min_length' => 1,
|
if ($nickname && !Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
$this->clientError(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
$this->clientError(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ class UserauthorizationAction extends Action
|
|||||||
$nickname = $_GET['omb_listenee_nickname'];
|
$nickname = $_GET['omb_listenee_nickname'];
|
||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
throw new OAuthException('Nickname must have only letters and numbers and no spaces.');
|
throw new OAuthException('Nickname must have only letters and numbers and no spaces.');
|
||||||
}
|
}
|
||||||
$profile = $_GET['omb_listenee_profile'];
|
$profile = $_GET['omb_listenee_profile'];
|
||||||
|
@ -238,7 +238,7 @@ class FBConnectauthAction extends Action
|
|||||||
|
|
||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -418,7 +418,7 @@ class FBConnectauthAction extends Action
|
|||||||
{
|
{
|
||||||
if (!Validate::string($str, array('min_length' => 1,
|
if (!Validate::string($str, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!User::allowed_nickname($str)) {
|
if (!User::allowed_nickname($str)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user