From 09d89d117ba24a58516649350764793be38b4b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Gu=C3=A9rard?= Date: Tue, 10 Jan 2012 00:27:09 +0100 Subject: [PATCH] =?UTF-8?q?Always=20decode=20HTML=C2=A0entities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fonctions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fonctions.php b/fonctions.php index e1b05b4..b0cb69c 100644 --- a/fonctions.php +++ b/fonctions.php @@ -167,7 +167,7 @@ function validateEmail($email) function sendEmail( $to, $subject, $body, $headers, $param) { - $to_list = explode( ',', $to ) ; + $to_list = explode( ',', html_entity_decode($to, ENT_QUOTES, 'UTF-8' ) ; $to = "" ; $first = 1 ; @@ -182,7 +182,8 @@ function sendEmail( $to, $subject, $body, $headers, $param) $first = 0 ; } ; - $subject = '=?UTF-8?B?' . base64_encode( $subject ) . '?=' ; + $subject = '=?UTF-8?B?' . base64_encode( html_entity_decode( $subject, ENT_QUOTES, 'UTF-8' ) ) . '?=' ; + $body = html_entity_decode( $body, ENT_QUOTES, 'UTF-8' ) ; mail( $to, $subject, $body, $headers, $param ) ;