diff options
author | Friendika <info@friendika.com> | 2010-12-07 14:11:26 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-12-07 14:11:26 -0800 |
commit | 32881234d002f017feacc67f21644ccd1803d3e2 (patch) | |
tree | ba38b87be40093b72e6fcf425e663362fe7c942c /mod/register.php | |
parent | dd185daf90e446f41a6b2dc202328b44b733a101 (diff) | |
download | volse-hubzilla-32881234d002f017feacc67f21644ccd1803d3e2.tar.gz volse-hubzilla-32881234d002f017feacc67f21644ccd1803d3e2.tar.bz2 volse-hubzilla-32881234d002f017feacc67f21644ccd1803d3e2.zip |
bring back full name check but without utf-8 regex's
Diffstat (limited to 'mod/register.php')
-rw-r--r-- | mod/register.php | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/mod/register.php b/mod/register.php index 973c54470..7ad7ef211 100644 --- a/mod/register.php +++ b/mod/register.php @@ -30,17 +30,12 @@ function register_post(&$a) { break; } - if(x($_POST,'username')) - $username = notags(trim($_POST['username'])); - if(x($_POST['nickname'])) - $nickname = notags(trim($_POST['nickname'])); - if(x($_POST,'email')) - $email = notags(trim($_POST['email'])); - if(x($_POST,'openid_url')) - $openid_url = notags(trim($_POST['openid_url'])); - - $photo = ((x($_POST,'photo')) ? notags(trim($_POST['photo'])) : ''); + $username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : ''); + $nickname = ((x($_POST,'nickname')) ? notags(trim($_POST['nickname'])) : ''); + $email = ((x($_POST,'email')) ? notags(trim($_POST['email'])) : ''); + $openid_url = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : ''); + $photo = ((x($_POST,'photo')) ? notags(trim($_POST['photo'])) : ''); if((! x($username)) || (! x($email)) || (! x($nickname))) { if($openid_url) { @@ -71,14 +66,15 @@ function register_post(&$a) { // I don't really like having this rule, but it cuts down // on the number of auto-registrations by Russian spammers -// $no_utf = get_config('system','no_utf'); - -// $pat = (($no_utf) ? '/^[a-zA-Z]* [a-zA-Z]*$/' : '/^\p{L}* \p{L}*$/u' ); + // Using preg_match was completely unreliable, due to mixed UTF-8 regex support + // $no_utf = get_config('system','no_utf'); + // $pat = (($no_utf) ? '/^[a-zA-Z]* [a-zA-Z]*$/' : '/^\p{L}* \p{L}*$/u' ); -// $loose_reg = get_config('system','no_regfullname'); - -// if((! $loose_reg) && (! preg_match($pat,$username))) -// $err .= t('That doesn\'t appear to be your full name.') . EOL; + // So now we are just looking for a space in the full name. + + $loose_reg = get_config('system','no_regfullname'); + if((! $loose_reg) && (! strpos($username,' '))) + $err .= t("That doesn\'t appear to be your full \x28First Last\x29 name.") . EOL; if(! allowed_email($email)) $err .= t('Your email domain is not among those allowed on this site.') . EOL; |