Commit 52e5e3a3 authored by Ad Schellevis's avatar Ad Schellevis

(snmp) validate location, contact for ascii set. closes https://github.com/opnsense/core/issues/939

parent 31fe2500
......@@ -66,10 +66,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// input validation
if (strstr($pconfig['syslocation'],"#")) {
$input_errors[] = gettext("Invalid character '#' in system location");
} elseif (preg_match('/[^\x20-\x7f]/', $pconfig['syslocation'])) {
$input_errors[] = gettext("Invalid character (non ascii) in system location");
}
if (strstr($pconfig['syscontact'],"#")) {
$input_errors[] = gettext("Invalid character '#' in system contact");
} elseif (preg_match('/[^\x20-\x7f]/', $pconfig['syscontact'])) {
$input_errors[] = gettext("Invalid character (non ascii) in system contact");
}
if (strstr($pconfig['rocommunity'],"#")) {
$input_errors[] = gettext("Invalid character '#' in read community string");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment