From 679c0f307933fae4f5117d5721368a006904c052 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sun, 21 Feb 2010 11:58:07 +0000 Subject: [PATCH] cleanups git-svn-id: http://www.observium.org/svn/observer/trunk@915 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/discovery/bgp-peers.inc.php | 2 +- includes/discovery/cisco-vlans.inc.php | 4 ++-- includes/discovery/processors-junos.inc.php | 2 +- includes/discovery/q-bridge-mib.inc.php | 6 +++--- includes/polling/interfaces.inc.php | 2 +- includes/polling/ports.inc.php | 2 +- includes/syslog.php | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/discovery/bgp-peers.inc.php b/includes/discovery/bgp-peers.inc.php index 8876643f7..d1c0f596b 100755 --- a/includes/discovery/bgp-peers.inc.php +++ b/includes/discovery/bgp-peers.inc.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_real_escape_string($astext) . "' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'"); + $update = mysql_query("UPDATE `bgpPeers` SET bgpPeerRemoteAs = " . $peer['as'] . ", astext = '" . mres($astext) . "' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['ip']."'"); echo("."); } diff --git a/includes/discovery/cisco-vlans.inc.php b/includes/discovery/cisco-vlans.inc.php index c541a9a90..62dcdfb57 100755 --- a/includes/discovery/cisco-vlans.inc.php +++ b/includes/discovery/cisco-vlans.inc.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_real_escape_string($vtp_domain) . "','$vlan', '" . mysql_real_escape_string($vlan_descr) . "')"); + mysql_query("INSERT INTO `vlans` (`device_id`,`vlan_domain`,`vlan_vlan`, `vlan_descr`) VALUES (" . $device['device_id'] . ",'" . mres($vtp_domain) . "','$vlan', '" . mres($vlan_descr) . "')"); echo("+"); } else { echo("."); - 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 . "'"); + mysql_query("UPDATE `vlans` SET `vlan_descr`='" . mres($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/processors-junos.inc.php b/includes/discovery/processors-junos.inc.php index b21390b80..e82d6c2ed 100755 --- a/includes/discovery/processors-junos.inc.php +++ b/includes/discovery/processors-junos.inc.php @@ -1,6 +1,6 @@ $ifAlias", $interface['device_id'], $interface['interface_id']); } diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index 1016711bf..ac8e7fd0c 100755 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -86,7 +86,7 @@ eventlog($oid . ": ".$port[$oid]." -> NULL", $device['device_id'], $port['interface_id']); if($debug) { echo($oid . ": ".$port[$oid]." -> NULL "); } else { echo($oid . " "); } } elseif ( $port[$oid] != $this_port[$oid] ) { - $update .= ", `$oid` = '".mysql_real_escape_string($this_port[$oid])."'"; + $update .= ", `$oid` = '".mres($this_port[$oid])."'"; eventlog($oid . ": ".$port[$oid]." -> " . $this_port[$oid], $device['device_id'], $port['interface_id']); if($debug) { echo($oid . ": ".$port[$oid]." -> " . $this_port[$oid]." "); } else { echo($oid . " "); } } diff --git a/includes/syslog.php b/includes/syslog.php index 260584301..fe795e89e 100755 --- a/includes/syslog.php +++ b/includes/syslog.php @@ -57,7 +57,7 @@ function process_syslog ($entry, $update) { list($entry['program'], $entry['msg']) = explode("||", $entry['msg']); } } - $x = "UPDATE `syslog` set `device_id` = '".$entry['device_id']."', `program` = '".$entry['program']."', `msg` = '" . mysql_real_escape_string($entry['msg']) . "', processed = '1' WHERE `seq` = '" . $entry['seq'] . "'"; + $x = "UPDATE `syslog` set `device_id` = '".$entry['device_id']."', `program` = '".$entry['program']."', `msg` = '" . mres($entry['msg']) . "', processed = '1' WHERE `seq` = '" . $entry['seq'] . "'"; $x = "INSERT INTO `syslog` (`device_id`,`program`,`facility`,`priority`, `level`, `tag`, `msg`, `timestamp`) "; $x .= "VALUES ('".$entry['device_id']."','".$entry['program']."','".$entry['facility']."','".$entry['priority']."', '".$entry['level']."', '".$entry['tag']."', '".$entry['msg']."','".$entry['timestamp']."')"; if($update && $entry['device_id']) { mysql_query($x); }