From ef6e4bc7b8a4e7c81ad2b613ceb54eeb5bea47ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Jul 2026 15:36:29 +0200 Subject: [PATCH] Doc --- htdocs/api/class/api_documents.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 54129daf627..5014a4fa4ba 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -650,9 +650,11 @@ class Documents extends DolibarrApi $filearray[$i]['note_public'] = $line->note_public; } } - if (isset($filearray[$i]['relativename'])) $filearray[$i]['content-type'] = dol_mimetype($filearray[$i]['relativename']); + if (isset($filearray[$i]['relativename'])) { + $filearray[$i]['content-type'] = dol_mimetype((string) $filearray[$i]['relativename']); + } $arraycontenttype = explode(",", $content_type); - if (!empty($content_type) && isset($filearray[$i]['relativename']) && !in_array(dol_mimetype($filearray[$i]['relativename']), $arraycontenttype)) { + if (!empty($content_type) && isset($filearray[$i]['relativename']) && !in_array(dol_mimetype((string) $filearray[$i]['relativename']), $arraycontenttype)) { unset($filearray[$i]); $countarray -= 1; }