From 490de707037bb13715b416432f8a1b369896637f Mon Sep 17 00:00:00 2001 From: TheWitness Date: Sat, 30 Sep 2023 16:01:20 -0400 Subject: [PATCH] QA On #5492 - Bad solution for Linux --- lib/snmp.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/snmp.php b/lib/snmp.php index 10a60a7ea5..40d6d524a6 100644 --- a/lib/snmp.php +++ b/lib/snmp.php @@ -933,19 +933,17 @@ function snmp_escape_string($string) { global $config; if (!defined('SNMP_ESCAPE_CHARACTER')) { - if ($config['cacti_server_os'] == 'win32') { - define('SNMP_ESCAPE_CHARACTER', '"'); - } + define('SNMP_ESCAPE_CHARACTER', '"'); + } + if ($config['cacti_server_os'] == 'win32') { if (substr_count($string, SNMP_ESCAPE_CHARACTER)) { $string = str_replace(SNMP_ESCAPE_CHARACTER, "\\" . SNMP_ESCAPE_CHARACTER, $string); return SNMP_ESCAPE_CHARACTER . $string . SNMP_ESCAPE_CHARACTER; - } else { - return cacti_escapeshellarg($string); } - } else { - return cacti_escapeshellarg($string); } + + return cacti_escapeshellarg($string); } function snmp_get_method($type = 'walk', $version = 1, $context = '', $engineid = '',