diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php index 44bbec8348..ffec1e6d01 100644 --- a/app/Http/Controllers/DeviceController.php +++ b/app/Http/Controllers/DeviceController.php @@ -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'));