Skip to content

Commit 6d817f5

Browse files
authored
Update CoreController.php
trim the sys_description to the first comma
1 parent a98cf9e commit 6d817f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/v1/controllers/CoreController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function actionSetDiscoveryResult(): array
214214
->where([
215215
'sysobject_id' => $data['sysobject_id'],
216216
'hw' => $data['hw'],
217-
'sys_description' => $data['sys_description']
217+
'sys_description' => preg_replace('/^([^,]+).*/s', '${1}', $data['sys_description'])
218218
])->scalar()
219219
;
220220

@@ -226,7 +226,7 @@ public function actionSetDiscoveryResult(): array
226226
'ip' => $data['ip'],
227227
'sysobject_id' => $data['sysobject_id'],
228228
'hw' => $data['hw'],
229-
'sys_description' => $data['sys_description']
229+
'sys_description' => preg_replace('/^([^,]+).*/s', '${1}', $data['sys_description'])
230230
];
231231

232232
$success = DeviceAttributesUnknown::addNewAttributes($attributes);

0 commit comments

Comments
 (0)