From be0f77b782472282cad466673ecebd42d0fb8e10 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 17 May 2023 14:56:00 +0200 Subject: [PATCH] #11202 Fixed url icon --- pandora_console/include/functions_visual_map.php | 7 ++++++- .../include/rest-api/models/VisualConsole/Items/Icon.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 80267a18e9..01e290b264 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -3173,7 +3173,12 @@ function visual_map_get_image_status_element($layoutData, $status=false) if ($layoutData['type'] == 5) { // ICON ELEMENT. - $img .= '.png'; + $url = parse_url($layoutData['image']); + if (isset($url['scheme']) === false) { + $img .= '.png'; + } else { + $img = $layoutData['image']; + } } else { if ($status === false) { $status = visual_map_get_status_element($layoutData); diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php b/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php index 81ae02209e..cd89dc3f52 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php @@ -116,7 +116,12 @@ final class Icon extends Item // Get the img src. $imagePath = \visual_map_get_image_status_element($data); - $data['imageSrc'] = \ui_get_full_url($imagePath, false, false, false); + $url = parse_url($imagePath); + if (isset($url['scheme']) === false) { + $data['imageSrc'] = \ui_get_full_url($imagePath, false, false, false); + } else { + $data['imageSrc'] = $imagePath; + } // If the width or the height are equal to 0 we will extract them // from the real image size.