mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Escape net-snmp unformatted strings, try 2 (#13584)
* Escape net-snmp unformatted strings, try 2 * Add some tests
This commit is contained in:
@@ -46,7 +46,7 @@ class SnmpFetch extends LnmsCommand
|
||||
$spec = $this->argument('device spec');
|
||||
$device_ids = Device::query()->when($spec !== 'all', function (Builder $query) use ($spec) {
|
||||
return $query->where('device_id', $spec)
|
||||
->orWhere('hostname', 'regexp', $spec);
|
||||
->orWhere('hostname', 'regexp', "^$spec$");
|
||||
})->pluck('device_id');
|
||||
|
||||
if ($device_ids->isEmpty()) {
|
||||
|
Reference in New Issue
Block a user