From 0c8d6093dcf17b5b6e8eba8b77ea3385bab37d51 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Wed, 24 Jan 2018 11:56:32 +0100 Subject: [PATCH] MDL-61261 badges: Add email validation during backpack configuration --- badges/backpack_form.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/badges/backpack_form.php b/badges/backpack_form.php index 417c96051ba..e1b51957e70 100644 --- a/badges/backpack_form.php +++ b/badges/backpack_form.php @@ -61,10 +61,10 @@ class edit_backpack_form extends moodleform { array('class' => 'notconnected', 'id' => 'connection-status')); $mform->addElement('static', 'status', get_string('status'), $status); $mform->addElement('hidden', 'email', $this->_customdata['email']); - $mform->setType('email', PARAM_RAW_TRIMMED); + $mform->setType('email', PARAM_EMAIL); $mform->hardFreeze(['email']); - $status = html_writer::tag('span', $this->_customdata['email'], []); - $mform->addElement('static', 'emailverify', get_string('email'), $status); + $emailverify = html_writer::tag('span', s($this->_customdata['email']), []); + $mform->addElement('static', 'emailverify', get_string('email'), $emailverify); $buttonarray = []; $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('backpackconnectionresendemail', 'badges')); @@ -80,7 +80,7 @@ class edit_backpack_form extends moodleform { $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"'); $mform->addHelpButton('email', 'backpackemail', 'badges'); $mform->addRule('email', get_string('required'), 'required', null, 'client'); - $mform->setType('email', PARAM_RAW_TRIMMED); + $mform->setType('email', PARAM_EMAIL); $this->add_action_buttons(false, get_string('backpackconnectionconnect', 'badges')); } }