From 03e9b5229545de2b96a793207b68e85716126a5a Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Fri, 19 Apr 2024 08:03:34 -0500 Subject: [PATCH] only call stripslashes if it is not compressed, compressed is already protected against munging by snmpd (#15953) --- includes/polling/functions.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index 88eb46e767..96b9aff2d1 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -470,10 +470,15 @@ function json_app_get($device, $extend, $min_version = 1) if (Debug::isVerbose()) { echo 'Decoded Base64+GZip Output: ' . $output . "\n\n"; } + } else { + $output = stripslashes($output); + if (Debug::isVerbose()) { + echo 'Output post stripslashes: ' . $output . "\n\n"; + } } // turn the JSON into a array - $parsed_json = json_decode(stripslashes($output), true); + $parsed_json = json_decode($output, true); // improper JSON or something else was returned. Populate the variable with an error. if (json_last_error() !== JSON_ERROR_NONE) {