Add one more trim() for (very) old printers (#5810)

* Add one more trim()

* Update sample
This commit is contained in:
rockyluke
2017-02-07 12:41:17 +01:00
committed by Neil Lathwood
parent 7240741b69
commit 1fb8135133

View File

@ -1,10 +1,11 @@
<?php
// ...253.8.51.1.2.1.20.1 = STRING: "MFG:Xerox;CMD:Adobe PostScript 3,PCL;MDL:Phaser 4510N;CLS:Printer;DES:Xerox Phaser 4510 Laser Printer, PostScript 3, Letter/A4 Size"
// ...253.8.51.1.2.1.20.1 = STRING: "MFG:Xerox;CMD:Adobe PostScript 3,PCL;MDL:ColorQube 8880DN;CLS:Printer;DES:Xerox ColorQube 8580 & 8880, Color Printer,PostScript 3,Letter/A4 Size "
$xinfo = explode(';', trim(snmp_get($device, '1.3.6.1.4.1.253.8.51.1.2.1.20.1', '-OQv', '', ''), '" '));
foreach ($xinfo as $xi) {
list($key,$value) = explode(':', $xi);
list($key,$value) = explode(':', trim($xi));
$xerox[$key] = $value;
}