Skip to content

Commit

Permalink
QA On #5492 - Bad solution for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Sep 30, 2023
1 parent c4bff1e commit 490de70
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/snmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '',
Expand Down

0 comments on commit 490de70

Please sign in to comment.