diff --git a/includes/discovery/bgp-peers.php b/includes/discovery/bgp-peers.php index d9a915eed2..6022cbb862 100755 --- a/includes/discovery/bgp-peers.php +++ b/includes/discovery/bgp-peers.php @@ -74,7 +74,7 @@ if (isset($peerlist)) $add = mysql_query("INSERT INTO bgpPeers (`device_id`, `bgpPeerIdentifier`, `bgpPeerRemoteAS`) VALUES ('".$device['device_id']."','".$peer['ip']."','".$peer['as']."')"); echo("+"); } else { - $update = mysql_query("UPDATE `bgpPeers` SET bgpPeerRemoteAs = " . $peer['as'] . ", astext = '" . mysql_escape_string($astext) . "' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'"); + $update = mysql_query("UPDATE `bgpPeers` SET bgpPeerRemoteAs = " . $peer['as'] . ", astext = '" . mysql_real_escape_string($astext) . "' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'"); echo("."); } diff --git a/includes/discovery/cisco-vlans.php b/includes/discovery/cisco-vlans.php index 74806c6a6a..c541a9a901 100755 --- a/includes/discovery/cisco-vlans.php +++ b/includes/discovery/cisco-vlans.php @@ -28,11 +28,11 @@ $vlan_descr = trim(str_replace("\"", "", $vlan_descr)); if(mysql_result(mysql_query("SELECT COUNT(vlan_id) FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "' AND `vlan_domain` = '" . $vtp_domain . "' AND `vlan_vlan` = '" . $vlan . "'"), 0) == '0') { - mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'" . mysql_escape_string($vtp_domain) . "','$vlan', '" . mysql_escape_string($vlan_descr) . "')"); + mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'" . mysql_real_escape_string($vtp_domain) . "','$vlan', '" . mysql_real_escape_string($vlan_descr) . "')"); echo("+"); } else { echo("."); - mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mysql_escape_string($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "' AND `vlan_domain`='" . $vtp_domain . "'"); + mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mysql_real_escape_string($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "' AND `vlan_domain`='" . $vtp_domain . "'"); } $this_vlans[] = $vlan; diff --git a/includes/discovery/q-bridge-mib.php b/includes/discovery/q-bridge-mib.php index 7562c17917..a0005fa35b 100644 --- a/includes/discovery/q-bridge-mib.php +++ b/includes/discovery/q-bridge-mib.php @@ -28,10 +28,10 @@ $vlan_descr = trim(str_replace("\"", "", $vlan_descr)); if(mysql_result(mysql_query("SELECT COUNT(vlan_id) FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "' AND `vlan_domain` = '' AND `vlan_vlan` = '" . $vlan . "'"), 0) == '0') { - mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'','$vlan', '" . mysql_escape_string($vlan_descr) . "')"); + mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'','$vlan', '" . mysql_real_escape_string($vlan_descr) . "')"); echo("+"); } else { - mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mysql_escape_string($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "'"); + mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mysql_real_escape_string($vlan_descr) . "' WHERE `device_id`='" . $device['device_id'] . "' AND `vlan_vlan`='" . $vlan . "'"); echo("."); }