From 76d6a30d4809095d71cd01de3aaee3eada50646f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 12 Jul 2023 16:30:34 +0200 Subject: [PATCH] FIX to avoid wrong path of file (#25320) --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 74f0eadfdf2..21d7f071043 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -808,7 +808,7 @@ class FormMail extends Form $relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val))); if ($conf->entity > 1) { - $relativepathtofile = str_replace($conf->entity.'/', '', $relativepathtofile); + $relativepathtofile = str_replace('/'.$conf->entity.'/', '/', $relativepathtofile); } // Try to extract data from full path $formfile_params = array();