From 947ab40bf2308dd1b64a53fb5039c34ef1a89aa4 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Wed, 14 Jan 2015 16:59:46 +0000 Subject: [PATCH] MDL-46976 user: trim whitespace from input email address Don't complain about invalid email address, we are a computer, we love the jobs users hate. ref: https://www.youtube.com/watch?v=5tquSbZEP-g --- login/forgot_password_form.php | 2 +- login/signup_form.php | 4 ++-- user/editlib.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/login/forgot_password_form.php b/login/forgot_password_form.php index 6dd5727938e..e506a18c791 100644 --- a/login/forgot_password_form.php +++ b/login/forgot_password_form.php @@ -54,7 +54,7 @@ class login_forgot_password_form extends moodleform { $mform->addElement('header', 'searchbyemail', get_string('searchbyemail'), ''); $mform->addElement('text', 'email', get_string('email')); - $mform->setType('email', PARAM_RAW); + $mform->setType('email', PARAM_RAW_TRIMMED); $submitlabel = get_string('search'); $mform->addElement('submit', 'submitbuttonemail', $submitlabel); diff --git a/login/signup_form.php b/login/signup_form.php index 8a0dbedd591..e64742ca795 100644 --- a/login/signup_form.php +++ b/login/signup_form.php @@ -53,11 +53,11 @@ class login_signup_form extends moodleform { $mform->addElement('header', 'supplyinfo', get_string('supplyinfo'),''); $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="25"'); - $mform->setType('email', PARAM_NOTAGS); + $mform->setType('email', PARAM_RAW_TRIMMED); $mform->addRule('email', get_string('missingemail'), 'required', null, 'server'); $mform->addElement('text', 'email2', get_string('emailagain'), 'maxlength="100" size="25"'); - $mform->setType('email2', PARAM_NOTAGS); + $mform->setType('email2', PARAM_RAW_TRIMMED); $mform->addRule('email2', get_string('missingemail'), 'required', null, 'server'); $namefields = useredit_get_required_name_fields(); diff --git a/user/editlib.php b/user/editlib.php index 62c114c78c7..9dc30f78690 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -215,7 +215,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null, $filemanager } else { $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"'); $mform->addRule('email', $strrequired, 'required', null, 'client'); - $mform->setType('email', PARAM_EMAIL); + $mform->setType('email', PARAM_RAW_TRIMMED); } $mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="21"');