MDL-10498: Apostrophe / Quote in username or email breaks profile update

Author: Aaron Barnes <[email protected]>
This commit is contained in:
peterbulmer
2009-01-12 02:02:06 +00:00
parent b8164f8b9e
commit bae9a29ec2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ class user_edit_form extends moodleform {
// validate email
if (!validate_email($usernew->email)) {
$err['email'] = get_string('invalidemail');
} else if (($usernew->email !== $user->email) and record_exists('user', 'email', $usernew->email, 'mnethostid', $CFG->mnet_localhost_id)) {
} else if ((stripslashes($usernew->email) !== $user->email) and record_exists('user', 'email', $usernew->email, 'mnethostid', $CFG->mnet_localhost_id)) {
$err['email'] = get_string('emailexists');
}
+1 -1
View File
@@ -135,7 +135,7 @@ class user_editadvanced_form extends moodleform {
}
}
if (!$user or $user->email !== $usernew->email) {
if (!$user or $user->email !== stripslashes($usernew->email)) {
if (!validate_email($usernew->email)) {
$err['email'] = get_string('invalidemail');
} else if (record_exists('user', 'email', $usernew->email, 'mnethostid', $CFG->mnet_localhost_id)) {