mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Trim whitespaces from device data (#14429)
* Trim whitespace from sensor and ports data * Update arista_eos_vrf.json * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update Os.php * wip * wip * wip * Update querybuilder.json
This commit is contained in:
@@ -6,10 +6,10 @@ unset($port_ifAlias);
|
||||
echo $this_port['ifAlias'];
|
||||
|
||||
$split = preg_split('/[:\[\]{}()]/', $this_port['ifAlias']);
|
||||
$type = $split[0] ?? null;
|
||||
$descr = trim($split[1] ?? null);
|
||||
$circuit = preg_split('/[{}]/', $this_port['ifAlias'])[1] ?? null;
|
||||
$notes = preg_split('/[()]/', $this_port['ifAlias'])[1] ?? null;
|
||||
$type = isset($split[0]) ? trim($split[0]) : null;
|
||||
$descr = isset($split[1]) ? trim($split[1]) : null;
|
||||
$circuit = trim(preg_split('/[{}]/', $this_port['ifAlias'])[1]) ?? null;
|
||||
$notes = trim(preg_split('/[()]/', $this_port['ifAlias'])[1]) ?? null;
|
||||
$speed = preg_split('/[\[\]]/', $this_port['ifAlias'])[1] ?? null;
|
||||
|
||||
if ($type && $descr) {
|
||||
|
||||
Reference in New Issue
Block a user