From 00a6a73e0d544e532f7193b4d377984634f996b9 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 15 Nov 2024 11:03:02 +0100 Subject: [PATCH] #1918 [Sheet] fix: export name failure on server --- view/sheet/sheet_export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/sheet/sheet_export.php b/view/sheet/sheet_export.php index 0c4f5820..1fa6dcaf 100644 --- a/view/sheet/sheet_export.php +++ b/view/sheet/sheet_export.php @@ -130,8 +130,8 @@ } $fileDir = $upload_dir . '/temp/'; - $exportName = (!empty($object->label) ? dol_string_nospecial($object->label, '_', '', ['-']) : $object->ref); - $fileName = dol_print_date(dol_now(), 'dayhourlog', 'tzuser') . '_dolibarr_' . $exportName . '_export'; + $exportName = str_replace(' ', '_', (!empty($object->label) ? $object->label : $object->ref)); + $fileName = dol_sanitizeFileName(dol_print_date(dol_now(), 'dayhourlog', 'tzuser') . '_' . dol_strtolower($exportName) . '_export'); $fullName = $fileDir . $fileName . '.json'; if (!is_dir($fileDir)) {