File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,11 @@ private function handleChanges(\LibreNMS\OS $os): void
153153 Log::info (trans ('device.attributes.location ' ) . ': ' . $ device ->location ?->display());
154154 foreach (['hardware ' , 'version ' , 'features ' , 'serial ' ] as $ attribute ) {
155155 if (isset ($ device ->$ attribute )) {
156- $ device ->$ attribute = trim ($ device ->$ attribute );
156+ $ device ->$ attribute = trim (preg_replace ('/^[\x00-\x1F\x7F-\xFF]+/ ' , '' , $ device ->$ attribute ));
157+ }
158+ if ($ device ->isDirty ($ attribute )) {
159+ Log::info (DeviceObserver::attributeChangedMessage ($ attribute , $ device ->$ attribute , $ device ->getOriginal ($ attribute )));
157160 }
158- Log::info (DeviceObserver::attributeChangedMessage ($ attribute , $ device ->$ attribute , $ device ->getOriginal ($ attribute )));
159161 }
160162
161163 $ device ->save ();
You can’t perform that action at this time.
0 commit comments