From 7fd4cc4bf79fbc23e3d95559d8c60a8bf57229f4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 20 Jun 2003 05:05:53 +0000 Subject: - Bugfix: fixed problem with the use of % on the user module form. Patch by Slavica. Fixes bug #1730. --- modules/user.module | 14 ++++++++++++++ modules/user/user.module | 14 ++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'modules') diff --git a/modules/user.module b/modules/user.module index 97568191e..e073b1e32 100644 --- a/modules/user.module +++ b/modules/user.module @@ -101,6 +101,8 @@ function user_save($account, $array = array()) { } else if (substr($key, 0, 4) !== "auth") { if (in_array($key, $user_fields)) { + // escape '%'s: + $value = str_replace("%", "%%", $value); $query .= "$key = '". check_query($value) ."', "; } else { @@ -264,6 +266,18 @@ function user_mail($mail, $subject, $message, $header) { ** - \r\n will work under dos and windows. ** - \n will work for linux, unix and BSDs. ** - \r will work for macs. + ** + ** According to RFC 2646, it's quite rude to not wrap your e-mails: + ** + ** "The Text/Plain media type is the lowest common denominator of + ** Internet email, with lines of no more than 997 characters (by + ** convention usually no more than 80), and where the CRLF sequence + ** represents a line break [MIME-IMT]." + ** + ** CRLF === \r\n + ** + ** http://www.rfc-editor.org/rfc/rfc2646.txt + ** */ return mail($mail, $subject, str_replace("\r", "", $message), $header); } diff --git a/modules/user/user.module b/modules/user/user.module index 97568191e..e073b1e32 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -101,6 +101,8 @@ function user_save($account, $array = array()) { } else if (substr($key, 0, 4) !== "auth") { if (in_array($key, $user_fields)) { + // escape '%'s: + $value = str_replace("%", "%%", $value); $query .= "$key = '". check_query($value) ."', "; } else { @@ -264,6 +266,18 @@ function user_mail($mail, $subject, $message, $header) { ** - \r\n will work under dos and windows. ** - \n will work for linux, unix and BSDs. ** - \r will work for macs. + ** + ** According to RFC 2646, it's quite rude to not wrap your e-mails: + ** + ** "The Text/Plain media type is the lowest common denominator of + ** Internet email, with lines of no more than 997 characters (by + ** convention usually no more than 80), and where the CRLF sequence + ** represents a line break [MIME-IMT]." + ** + ** CRLF === \r\n + ** + ** http://www.rfc-editor.org/rfc/rfc2646.txt + ** */ return mail($mail, $subject, str_replace("\r", "", $message), $header); } -- cgit v1.2.3