From 608c174245ed8825366e40254e93bd57f777356d Mon Sep 17 00:00:00 2001 From: rub Date: Fri, 12 Oct 2007 22:14:23 +0000 Subject: Replace htmlentities by htmlspecialchars on NBM in order to send a correct UTF8 mail. Quote mail charset + add debug mail informations Fix "check user with same mail" where null email was not discarded git-svn-id: http://piwigo.org/svn/trunk@2136 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/notification_by_mail.php | 2 +- include/functions_mail.inc.php | 3 +++ plugins/c13y_upgrade/initialize.inc.php | 1 + template/yoga/mail/text/html/header.tpl | 2 +- template/yoga/mail/text/plain/header.tpl | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php index 377aed03e..ca59b3158 100644 --- a/admin/notification_by_mail.php +++ b/admin/notification_by_mail.php @@ -247,7 +247,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l { // On HTML mail, detects if the content are HTML format. // If it's plain text format, convert content to readable HTML - $customize_mail_content = nl2br(htmlentities($customize_mail_content)); + $customize_mail_content = nl2br(htmlspecialchars($customize_mail_content)); } // Prepare message after change language diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index 9d69f474e..b4ad2c4e3 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -704,6 +704,9 @@ function pwg_mail($to, $args = array()) $filename .= '.html'; } $file = fopen($filename, 'w+'); + fwrite($file, $to); + fwrite($file, $cvt_subject); + fwrite($file, $headers); fwrite($file, $content); fclose($file); return true; diff --git a/plugins/c13y_upgrade/initialize.inc.php b/plugins/c13y_upgrade/initialize.inc.php index df53d01db..7cb3f7191 100644 --- a/plugins/c13y_upgrade/initialize.inc.php +++ b/plugins/c13y_upgrade/initialize.inc.php @@ -43,6 +43,7 @@ function c13y_upgrade($c13y_array) $query = ' select count(*) from '.USERS_TABLE.' +where '.$conf['user_fields']['email'].' is not null group by upper('.$conf['user_fields']['email'].') having count(*) > 1 limit 0,1 diff --git a/template/yoga/mail/text/html/header.tpl b/template/yoga/mail/text/html/header.tpl index 37df3bad9..716a498e6 100644 --- a/template/yoga/mail/text/html/header.tpl +++ b/template/yoga/mail/text/html/header.tpl @@ -1,5 +1,5 @@ -----={BOUNDARY_KEY} -Content-Type: {CONTENT_TYPE}; charset={CONTENT_ENCODING}; +Content-Type: {CONTENT_TYPE}; charset="{CONTENT_ENCODING}"; Content-Transfer-Encoding: 8bit diff --git a/template/yoga/mail/text/plain/header.tpl b/template/yoga/mail/text/plain/header.tpl index ce7667106..213fedbf1 100644 --- a/template/yoga/mail/text/plain/header.tpl +++ b/template/yoga/mail/text/plain/header.tpl @@ -1,3 +1,3 @@ -----={BOUNDARY_KEY} -Content-Type: {CONTENT_TYPE}; charset={CONTENT_ENCODING}; +Content-Type: {CONTENT_TYPE}; charset="{CONTENT_ENCODING}"; Content-Transfer-Encoding: 8bit -- cgit v1.2.3