mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
404 when device does not exist
This commit is contained in:
@ -57,12 +57,16 @@ class DeviceController extends Controller
|
||||
|
||||
public function index(Request $request, $device_id, $current_tab = 'overview', $vars = '')
|
||||
{
|
||||
|
||||
$device_id = (int)str_replace('device=', '', $device_id);
|
||||
$current_tab = str_replace('tab=', '', $current_tab);
|
||||
$current_tab = array_key_exists($current_tab, $this->tabs) ? $current_tab : 'overview';
|
||||
DeviceCache::setPrimary($device_id);
|
||||
$device = DeviceCache::getPrimary();
|
||||
|
||||
if (!$device->exists) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
if ($current_tab == 'port') {
|
||||
$vars = Url::parseLegacyPath($request->path());
|
||||
$port = Port::findOrFail($vars->get('port'));
|
||||
|
Reference in New Issue
Block a user