From 1beb669bb7debe0f6a8dcd3700609b0f80132429 Mon Sep 17 00:00:00 2001 From: Lars Michelsen Date: Wed, 24 Jan 2024 11:31:16 +0100 Subject: [PATCH] FIX: Fix failing reporting of errors when messages contained special characters --- ChangeLog | 2 ++ share/frontend/nagvis-js/classes/ViewError.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2eca19918..6ea54d6c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ 1.9.41 +Frontend: + * FIX: Fix failing reporting of errors when messages contained special characters 1.9.40 Core: diff --git a/share/frontend/nagvis-js/classes/ViewError.php b/share/frontend/nagvis-js/classes/ViewError.php index 0cbb90857..9afe61fba 100644 --- a/share/frontend/nagvis-js/classes/ViewError.php +++ b/share/frontend/nagvis-js/classes/ViewError.php @@ -35,8 +35,8 @@ private function errorPage($e) { js('frontendMessage({'.N .' "type" : "error",'.N .' "closable": false,'.N - .' "title" : "'.l('Error').'",'.N - .' "message" : "'.htmlentities($e->getMessage(), ENT_COMPAT, 'UTF-8').'"'.N + .' "title" : '.json_encode(l('Error')).','.N + .' "message" : '.json_encode(htmlentities($e->getMessage(), ENT_COMPAT, 'UTF-8')).N .'});'); echo '';