mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: Stop stripping html tags from snmp creds (#7951)
This commit is contained in:
committed by
Tony Murray
parent
f75079ab47
commit
27368a2d98
@@ -52,7 +52,7 @@ if ($hostname !== false) {
|
|||||||
);
|
);
|
||||||
} elseif ($_POST['snmpver'] === 'v2c' || $_POST['snmpver'] === 'v1') {
|
} elseif ($_POST['snmpver'] === 'v2c' || $_POST['snmpver'] === 'v1') {
|
||||||
if ($_POST['community']) {
|
if ($_POST['community']) {
|
||||||
$config['snmp']['community'] = array(clean($_POST['community']));
|
$config['snmp']['community'] = array(clean($_POST['community'], false));
|
||||||
}
|
}
|
||||||
|
|
||||||
$snmpver = clean($_POST['snmpver']);
|
$snmpver = clean($_POST['snmpver']);
|
||||||
@@ -60,11 +60,11 @@ if ($hostname !== false) {
|
|||||||
} elseif ($_POST['snmpver'] === 'v3') {
|
} elseif ($_POST['snmpver'] === 'v3') {
|
||||||
$v3 = array(
|
$v3 = array(
|
||||||
'authlevel' => clean($_POST['authlevel']),
|
'authlevel' => clean($_POST['authlevel']),
|
||||||
'authname' => clean($_POST['authname']),
|
'authname' => clean($_POST['authname'], false),
|
||||||
'authpass' => clean($_POST['authpass']),
|
'authpass' => clean($_POST['authpass'], false),
|
||||||
'authalgo' => clean($_POST['authalgo']),
|
'authalgo' => clean($_POST['authalgo']),
|
||||||
'cryptopass' => clean($_POST['cryptopass']),
|
'cryptopass' => clean($_POST['cryptopass'], false),
|
||||||
'cryptoalgo' => clean($_POST['cryptoalgo']),
|
'cryptoalgo' => clean($_POST['cryptoalgo'], false),
|
||||||
);
|
);
|
||||||
|
|
||||||
array_push($config['snmp']['v3'], $v3);
|
array_push($config['snmp']['v3'], $v3);
|
||||||
|
@@ -1513,11 +1513,16 @@ function print_list($list, $format, $max = 10)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
|
* @param bool $strip_tags
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function clean($value)
|
function clean($value, $strip_tags = true)
|
||||||
{
|
{
|
||||||
|
if ($strip_tags === true) {
|
||||||
return strip_tags(mres($value));
|
return strip_tags(mres($value));
|
||||||
|
} else {
|
||||||
|
return mres($value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user