mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated for scrut issues
This commit is contained in:
@ -666,7 +666,6 @@ function get_inventory() {
|
|||||||
$router = $app->router()->getCurrentRoute()->getParams();
|
$router = $app->router()->getCurrentRoute()->getParams();
|
||||||
$status = 'error';
|
$status = 'error';
|
||||||
$err_msg = '';
|
$err_msg = '';
|
||||||
$message = '';
|
|
||||||
$code = 500;
|
$code = 500;
|
||||||
$hostname = $router['hostname'];
|
$hostname = $router['hostname'];
|
||||||
// use hostname as device_id if it's all digits
|
// use hostname as device_id if it's all digits
|
||||||
@ -685,6 +684,8 @@ function get_inventory() {
|
|||||||
}
|
}
|
||||||
if (!is_numeric($device_id)) {
|
if (!is_numeric($device_id)) {
|
||||||
$err_msg = 'Invalid device provided';
|
$err_msg = 'Invalid device provided';
|
||||||
|
$total_inv = 0;
|
||||||
|
$inventory = array();
|
||||||
} else {
|
} else {
|
||||||
$inventory = dbFetchRows("SELECT * FROM `entPhysical` WHERE 1 $sql",$params);
|
$inventory = dbFetchRows("SELECT * FROM `entPhysical` WHERE 1 $sql",$params);
|
||||||
$code = 200;
|
$code = 200;
|
||||||
|
Reference in New Issue
Block a user