From 256750bcb00395425394f2d61280eea302c5dae9 Mon Sep 17 00:00:00 2001
From: "alejandro.campos@artica.es" <alejandro.campos@artica.es>
Date: Wed, 5 May 2021 09:51:21 +0200
Subject: [PATCH] fixed bug in file attachment

---
 .../incidents/dashboard_detail_integriaims_incident.php     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php
index c4d7cb8617..d534df5902 100644
--- a/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php
+++ b/pandora_console/operation/incidents/dashboard_detail_integriaims_incident.php
@@ -159,7 +159,9 @@ if ($upload_file && ($_FILES['userfile']['name'] != '')) {
 
         $filecontent = base64_encode(file_get_contents($_FILES['userfile']['tmp_name']));
 
-        $result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', ';');
+        $filename = str_replace('&#x20;', '+', $filename);
+
+        $result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', '|;|');
 
         // API method returns '0' string if success.
         $file_added = ($result_api_call === '0') ? true : false;
@@ -485,4 +487,4 @@ $(document).ready (function () {
     });
 
 });
-</script>
\ No newline at end of file
+</script>