diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b98463057eb..cd810b12208 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8070,7 +8070,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = ' // Here, $object->id, $object->ref and $modulepart are required. if (in_array($modulepart, array('societe', 'thirdparty')) && $object instanceOf Societe) { // Special case for thirdparty, where the ref is a company name that is not unique so path on disk is using the ID instead of the ref - $path = dol_sanitizeFileName($object->id); + $path = dol_sanitizeFileName((string) $object->id); } else { $path = dol_sanitizeFileName(empty($object->ref) ? (string) ((is_object($object) && property_exists($object, 'id')) ? $object->id : '') : $object->ref); }