From e955c077f6d2d58cf22c86784421684e59e2bd75 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Mon, 13 Oct 2025 15:40:00 +0200 Subject: [PATCH 01/13] fix(Core): fix display --- inc/common.class.php | 2 +- inc/graph.class.php | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/inc/common.class.php b/inc/common.class.php index e13e478e..3e5d7d24 100644 --- a/inc/common.class.php +++ b/inc/common.class.php @@ -1018,7 +1018,7 @@ public static function showGraphDatas( echo ""; echo '' . htmlspecialchars($label2) . ''; if ($simpledatas) { //simple array - echo "" . htmlspecialchars($cols) . ' ' . htmlspecialchars($unit) . ''; + echo "" . htmlspecialchars($cols) . ' ' . htmlspecialchars($unit ?? '') . ''; } else { //multiple array foreach ($cols as $date => $nb) { if (!is_array($nb)) { diff --git a/inc/graph.class.php b/inc/graph.class.php index 54a84e7a..fd23158d 100644 --- a/inc/graph.class.php +++ b/inc/graph.class.php @@ -105,7 +105,10 @@ public function initGraph($options) echo "
"; - $colors = htmlspecialchars("'" . implode("', '", PluginMreportingConfig::getColors()) . "'"); + + $colorsArray = PluginMreportingConfig::getColors(); + $escapedColors = array_map(fn($color) => htmlspecialchars($color, ENT_QUOTES, 'UTF-8'), $colorsArray); + $colors = "'" . implode("', '", $escapedColors) . "'"; echo "