From ef52a200213f804addc4506799b07bbcf8799ab8 Mon Sep 17 00:00:00 2001 From: "cedric@yterium.com" <> Date: Mon, 4 Mar 2013 16:56:36 +0000 Subject: [PATCH] =?UTF-8?q?Quand=20le=20mail=20est=20vide=20en=20entree=20?= =?UTF-8?q?de=20facteur=5Femail=5Fwrap=5Fto=5Fhtml(),=20on=20renvoit=20du?= =?UTF-8?q?=20vide=20aussi,=20pour=20ne=20pas=20g=C3=A9n=C3=A9rer=20un=20m?= =?UTF-8?q?ail=20HTML=20plein=20de=20vide=20(et=20ne=20pas=20fausser=20la?= =?UTF-8?q?=20detection=20de=20mail=20vide=20pour=20les=20nouveaut=C3=A9s)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emails/texte.html | 1 + facteur_fonctions.php | 7 +++++++ paquet.xml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/emails/texte.html b/emails/texte.html index 9fc89fe..80f2492 100644 --- a/emails/texte.html +++ b/emails/texte.html @@ -21,6 +21,7 @@ .bodyContent div a:link, .bodyContent div a:visited {color: #336699;font-weight: normal;text-decoration: underline;} .bodyContent img {display: inline;margin-bottom: 10px;} .bodyContent img.puce {display: inline;margin-bottom: 0;} + hr { height: 1px; margin: 1.5em 0; border: 0; background: #222222; color: #222222; } .spip_code, .spip_cadre {color: #606060;font-family: Courier,"Courier New",monospace;font-size: 1em;} .coloration_code ol {list-style: none;} .spip_logos {float: right;margin-left: 10px;} diff --git a/facteur_fonctions.php b/facteur_fonctions.php index fdfd904..3abf19a 100755 --- a/facteur_fonctions.php +++ b/facteur_fonctions.php @@ -24,6 +24,9 @@ if (!defined("_ECRIRE_INC_VERSION")) return; */ function facteur_email_wrap_to_html($texte_ou_html){ $texte_ou_html = trim($texte_ou_html); + // attention : si pas de contenu on renvoi du vide aussi (mail vide = mail vide) + if (!strlen(trim($texte_ou_html))) + return $texte_ou_html; $contexte = array("sujet"=>"","texte"=>"","intro"=>""); @@ -53,6 +56,10 @@ function facteur_email_wrap_to_html($texte_ou_html){ $contexte['texte'] = trim(implode("\n",$texte_ou_html)); } + // attention : si pas de contenu on renvoi du vide aussi (mail vide = mail vide) + if (!strlen(trim(implode("",$contexte)))) + return ""; + return recuperer_fond("emails/texte",$contexte); } diff --git a/paquet.xml b/paquet.xml index 41e9ec7..17de55c 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@