From: moodler Date: Tue, 27 Apr 2004 08:24:04 +0000 (+0000) Subject: Allow some European characters in the username bug 1249 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=36c34ab6f628a72dea836a889fd91e47ab9f3e3e;p=moodle.git Allow some European characters in the username bug 1249 --- diff --git a/login/signup.php b/login/signup.php index c5a740be29..8842d6bd43 100644 --- a/login/signup.php +++ b/login/signup.php @@ -88,7 +88,7 @@ function validate_form($user, &$err) { if (record_exists("user", "username", $user->username)){ $err->username = get_string("usernameexists"); } else { - $string = eregi_replace("[^(-\.[:alnum:])]", "", $user->username); + $string = eregi_replace("[^(-\.[:alnum:][À-ÖØ-öø-ÿ])]", "", $user->username); if (strcmp($user->username, $string)) { $err->username = get_string("alphanumerical"); } diff --git a/user/edit.php b/user/edit.php index d9ecb27da5..4c3858ce65 100644 --- a/user/edit.php +++ b/user/edit.php @@ -200,7 +200,8 @@ function find_form_errors(&$user, &$usernew, &$err) { $err["username"] = get_string("usernameexists"); } else { - $string = eregi_replace("[^(-\.[:alnum:])]", "", $usernew->username); + $string = eregi_replace("[^(-\.[:alnum:][À-ÖØ-öø-ÿ])]", "", $usernew->username); + if (strcmp($usernew->username, $string)) $err["username"] = get_string("alphanumerical"); }