From a692c73071f07ff8a94ab4c5e529a88e5bb75fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 5 Oct 2025 16:59:16 +0200 Subject: [PATCH 1/2] fix select nature member in adherent/admin/website.php (#35641) --- htdocs/adherents/admin/website.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 8ac296f9449..ce62e2584cd 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -225,7 +225,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { print ''; print $langs->trans("ForceMemberNature"); print ''; - $forcenature = getDolGlobalInt('MEMBER_NEWFORM_FORCEMORPHY', 0); + $forcenature = getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY'); // 'phy' or 'mor' print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1); print "\n"; From 8146025b0896ab1eccaf908c238a1495ea9e6f0c Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Wed, 8 Oct 2025 20:24:56 +0200 Subject: [PATCH 2/2] Fix #35521 - properly display embedded images in mailings (#35523) * fix embedded images * fix php stan * fix php stan * Update CMailFile.class.php * Update CMailFile.class.php * Update CMailFile.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/CMailFile.class.php | 31 ++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 5e5a6ee9936..d04a13ce257 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2025 Joachim Kueter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -585,7 +586,9 @@ class CMailFile if (!empty($this->atleastonefile)) { foreach ($filename_list as $i => $val) { $content = file_get_contents($filename_list[$i]); - $smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], (empty($cid_list[$i]) ? '' : $cid_list[$i])); + if (empty($cid_list[$i])) { + $smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], (empty($cid_list[$i]) ? '' : $cid_list[$i])); + } } } @@ -1787,15 +1790,17 @@ class CMailFile $mimetype_list[$i] = "application/octet-stream"; } + // Skip files that have a CID (they will be added as inline images instead) + if (!empty($cidlist) && is_array($cidlist) && isset($cidlist[$i]) && $cidlist[$i] !== null && $cidlist[$i] !== '') { + continue; // Skip this file as it will be processed as inline image + } + $out .= "--".$this->mixed_boundary.$this->eol; + $out .= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol; $out .= "Content-Type: ".$mimetype_list[$i]."; name=\"".$filename_list[$i]."\"".$this->eol; $out .= "Content-Transfer-Encoding: base64".$this->eol; $out .= "Content-Description: ".$filename_list[$i].$this->eol; - if (!empty($cidlist) && is_array($cidlist) && $cidlist[$i]) { - $out .= "X-Attachment-Id: ".$cidlist[$i].$this->eol; - $out .= "Content-ID: <".$cidlist[$i].'>'.$this->eol; - } $out .= $this->eol; $out .= $encoded; $out .= $this->eol; @@ -2123,6 +2128,22 @@ class CMailFile $i++; } + // Also add cidfromdata images to images_encoded array so they are sent as inline images + foreach ($this->html_images as $img) { + if ($img['type'] == 'cidfromdata') { + $image_content = file_get_contents($img['fullpath']); + if ($image_content !== false) { + $idx = count($this->images_encoded); + $this->images_encoded[$idx]['name'] = $img['name']; + $this->images_encoded[$idx]['fullpath'] = $img['fullpath']; + $this->images_encoded[$idx]['content_type'] = $img['content_type']; + $this->images_encoded[$idx]['cid'] = $img['cid']; + $this->images_encoded[$idx]['type'] = 'cidfromdata'; + $this->images_encoded[$idx]['image_encoded'] = chunk_split(base64_encode($image_content), 68, $this->eol); + } + } + } + return 1; } else { return 0;