mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 08:01:38 +02:00
Added null check for $id
This commit is contained in:
@@ -920,6 +920,12 @@ function validate_device_id($id)
|
||||
{
|
||||
|
||||
global $config;
|
||||
if(empty($id) || !is_numeric($id))
|
||||
{
|
||||
$return = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$device_id = dbFetchCell("SELECT `device_id` FROM `devices` WHERE `device_id` = ?", array($id));
|
||||
if($device_id == $id)
|
||||
{
|
||||
@@ -929,6 +935,7 @@ function validate_device_id($id)
|
||||
{
|
||||
$return = false;
|
||||
}
|
||||
}
|
||||
return($return);
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user