mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 02:48:37 +00:00
Merge pull request #11830 from murrant/device-not-found
404 when device does not exist
This commit is contained in:
commit
4e95f667df
@ -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'));
|
||||
|
Loading…
Reference in New Issue
Block a user