mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Merge pull request #2382 from khobbits/patch-1
Quote column titles when sql building to avoid mysql keywords
This commit is contained in:
@@ -65,5 +65,6 @@ Contributors to LibreNMS:
|
||||
- Sebastian Neuner <sebastian@sneuner.org> (9er)
|
||||
- Robert Zollner <wolfit_ro@yahoo.com> (Lupul)
|
||||
- Richard Hartmann <richih@debian.org> (RichiH)
|
||||
- Robert Gornall <roblnm@khobbits.co.uk (KHobbits)
|
||||
|
||||
[1]: http://observium.org/ "Observium web site"
|
||||
|
||||
@@ -163,23 +163,23 @@ function list_devices() {
|
||||
}
|
||||
|
||||
if (stristr($order, ' desc') === false && stristr($order, ' asc') === false) {
|
||||
$order .= ' ASC';
|
||||
$order = '`'.$order.'` ASC';
|
||||
}
|
||||
|
||||
if ($type == 'all' || empty($type)) {
|
||||
$sql = '1';
|
||||
}
|
||||
elseif ($type == 'ignored') {
|
||||
$sql = "ignore='1' AND disabled='0'";
|
||||
$sql = "`ignore`='1' AND `disabled`='0'";
|
||||
}
|
||||
elseif ($type == 'up') {
|
||||
$sql = "status='1' AND ignore='0' AND disabled='0'";
|
||||
$sql = "`status`='1' AND `ignore`='0' AND `disabled`='0'";
|
||||
}
|
||||
elseif ($type == 'down') {
|
||||
$sql = "status='0' AND ignore='0' AND disabled='0'";
|
||||
$sql = "`status`='0' AND `ignore`='0' AND `disabled`='0'";
|
||||
}
|
||||
elseif ($type == 'disabled') {
|
||||
$sql = "disabled='1'";
|
||||
$sql = "`disabled`='1'";
|
||||
}
|
||||
elseif ($type == 'mac') {
|
||||
$join = " LEFT JOIN `ports` ON `devices`.`device_id`=`ports`.`device_id` LEFT JOIN `ipv4_mac` ON `ports`.`port_id`=`ipv4_mac`.`port_id` ";
|
||||
|
||||
Reference in New Issue
Block a user