From 7b7e16d0e311a217a17c27e9ca372f82e91df26f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luciana=20Nu=C3=B1ez?= Date: Thu, 23 Feb 2023 12:51:17 -0400 Subject: [PATCH] PMCORE-3704 --- workflow/engine/src/ProcessMaker/Model/CaseList.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/Model/CaseList.php b/workflow/engine/src/ProcessMaker/Model/CaseList.php index b6ee8bd01..3d7a09168 100644 --- a/workflow/engine/src/ProcessMaker/Model/CaseList.php +++ b/workflow/engine/src/ProcessMaker/Model/CaseList.php @@ -354,6 +354,10 @@ class CaseList extends Model } $content = file_get_contents($_FILES['file_content']['tmp_name']); try { + // Check if the content is a binary string and convert to a string + if (preg_match('~[^\x20-\x7E\t\r\n]~', $content) > 0) { + $content = mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true)); + } $array = json_decode($content, true); $tableName = $array['tableName'];