From 00686feea96c36ec2406339bc622e89f85ce901f Mon Sep 17 00:00:00 2001 From: pierrepomes Date: Sun, 17 Oct 2010 22:44:37 -0400 Subject: [PATCH] Character '#' is invalid in string fields of SNMP service screen. Ticket #956 --- usr/local/www/services_snmp.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php index d3cda15d22..8b79c666f9 100755 --- a/usr/local/www/services_snmp.php +++ b/usr/local/www/services_snmp.php @@ -84,6 +84,10 @@ if ($_POST) { /* input validation */ if ($_POST['enable']) { + if (strstr($_POST['syslocation'],"#")) $input_errors[] = gettext("Invalid character '#' in system location"); + if (strstr($_POST['syscontact'],"#")) $input_errors[] = gettext("Invalid character '#' in system contact"); + if (strstr($_POST['rocommunity'],"#")) $input_errors[] = gettext("Invalid character '#' in read community string"); + $reqdfields = explode(" ", "rocommunity"); $reqdfieldsn = array(gettext("Community")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -96,6 +100,8 @@ if ($_POST) { } if ($_POST['trapenable']) { + if (strstr($_POST['trapstring'],"#")) $input_errors[] = gettext("Invalid character '#' in SNMP trap string"); + $reqdfields = explode(" ", "trapserver"); $reqdfieldsn = array(gettext("Trap server")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);