X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fprofilesettings.php;h=44243f310d95adcd8318b910c81f0d5b28643332;hb=f374e924f51d50a601bef4beeb138665374485b0;hp=6764ad288f51684085981c76e407fb252e5fbf1b;hpb=b4d8bbdad7b3a9f04ea93800924b37a9b256facc;p=quix0rs-gnu-social.git diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 6764ad288f..44243f310d 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -80,7 +80,7 @@ class ProfilesettingsAction extends SettingsAction { # Some validation - if (!is_null($email) && !Validate::email($email, true)) { + if ($email && !Validate::email($email, true)) { $this->show_form(_t('Not a valid email address.')); return; } else if (!Validate::string($nickname, array('min_length' => 1, @@ -88,6 +88,9 @@ class ProfilesettingsAction extends SettingsAction { 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { $this->show_form(_t('Nickname must have only letters and numbers and no spaces.')); return; + } else if (!User::allowed_nickname($nickname)) { + $this->show_form(_t('Not a valid nickname.')); + return; } else if (!is_null($homepage) && (strlen($homepage) > 0) && !Validate::uri($homepage, array('allowed_schemes' => array('http', 'https')))) { $this->show_form(_t('Homepage is not a valid URL.')); @@ -208,4 +211,4 @@ class ProfilesettingsAction extends SettingsAction { return $other->id != $user->id; } } -} \ No newline at end of file +}