From 014748da64fab267e898db6faa71f506d68a0476 Mon Sep 17 00:00:00 2001 From: tofulm Date: Thu, 30 Mar 2023 17:45:27 +0200 Subject: [PATCH] fix: warning --- inc/gamumail_remplacements.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/inc/gamumail_remplacements.php b/inc/gamumail_remplacements.php index a291cca..220f06c 100644 --- a/inc/gamumail_remplacements.php +++ b/inc/gamumail_remplacements.php @@ -5,12 +5,12 @@ if (!defined('_ECRIRE_INC_VERSION')) { /** * fonction pour les remplacements génériques fournis par gamumail - * + * * @param array $args = ['slug' => $slug, 'destinataires' => $pour, [$options]] * @param string $data = $html - * + * * @return $html - * + * **/ function inc_gamumail_remplacements_dist($args, $html) { /** @@ -24,8 +24,12 @@ function inc_gamumail_remplacements_dist($args, $html) { and $prenom = sql_getfetsel('prenom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]))) { $nom = $prenom.' '.$nom; } - $html = gamumail_remplacer_modele('nom', ucwords($nom), $html); - $html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html); + if ($nom) { + $html = gamumail_remplacer_modele('nom', ucwords($nom), $html); + } + if ($prenom) { + $html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html); + } /** * @@url_site@@ => URL du site