only call stripslashes if it is not compressed, compressed is already protected against munging by snmpd (#15953)

This commit is contained in:
Zane C. Bowers-Hadley
2024-04-19 08:03:34 -05:00
committed by GitHub
parent 19344f0584
commit 03e9b52295

View File

@@ -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) {