]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-16554, strip slashes in email, checkin the patch"
authordongsheng <dongsheng>
Mon, 22 Sep 2008 03:21:39 +0000 (03:21 +0000)
committerdongsheng <dongsheng>
Mon, 22 Sep 2008 03:21:39 +0000 (03:21 +0000)
lib/moodlelib.php

index d67a9adb8a3ef6e324540752b417c27ee20b7b19..3a6132637eeb55b4755e3e4bc66a9977086a60d0 100644 (file)
@@ -4110,7 +4110,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a
         $mail->From     = $CFG->noreplyaddress;
         $mail->FromName = $from;
     } else if ($usetrueaddress and $from->maildisplay) {
-        $mail->From     = $from->email;
+        $mail->From     = stripslashes($from->email);
         $mail->FromName = fullname($from);
     } else {
         $mail->From     = $CFG->noreplyaddress;
@@ -4126,7 +4126,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a
 
     $mail->Subject = substr($subject, 0, 900);
 
-    $mail->AddAddress($user->email, fullname($user) );
+    $mail->AddAddress(stripslashes($user->email), fullname($user) );
 
     $mail->WordWrap = $wordwrapwidth;                   // set word wrap