Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-13572_validate_email_22' of git://github.com/andyjd…

…avis/moodle into MOODLE_22_STABLE
  • Loading branch information...
commit 7f7d9ce6e88493113b264350f2ef79f51358bb8f 2 parents 58a44ab + 925d068
@samhemelryk samhemelryk authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 message/output/email/message_output_email.php
View
11 message/output/email/message_output_email.php
@@ -68,12 +68,19 @@ function send_message($eventdata) {
* @param object $mform preferences form class
*/
function config_form($preferences){
- global $USER;
- $string = get_string('email','message_email').': <input size="30" name="email_email" value="'.$preferences->email_email.'" />';
+ global $USER, $OUTPUT;
+
+ $inputattributes = array('size'=>'30', 'name'=>'email_email', 'value'=>$preferences->email_email);
+ $string = get_string('email','message_email') . ': ' . html_writer::empty_tag('input', $inputattributes);
if (empty($preferences->email_email) && !empty($preferences->userdefaultemail)) {
$string .= ' ('.get_string('default').': '.$preferences->userdefaultemail.')';
}
+
+ if (!empty($preferences->email_email) && !validate_email($preferences->email_email)) {
+ $string .= $OUTPUT->container(get_string('invalidemail'), 'error');
+ }
+
return $string;
}

0 comments on commit 7f7d9ce

Please sign in to comment.
Something went wrong with that request. Please try again.