Fix ArubaInstance channel decode issue (#14732)

* Fix ArubaInstance channel decode issue
PHP no longer implicitly casts in this situation

* missing import
This commit is contained in:
Tony Murray
2022-12-15 19:36:57 -06:00
committed by GitHub
parent e84b2c0c75
commit 510f9d340d

View File

@@ -41,6 +41,7 @@ use LibreNMS\Interfaces\Polling\Sensors\WirelessApCountPolling;
use LibreNMS\Interfaces\Polling\Sensors\WirelessClientsPolling; use LibreNMS\Interfaces\Polling\Sensors\WirelessClientsPolling;
use LibreNMS\Interfaces\Polling\Sensors\WirelessFrequencyPolling; use LibreNMS\Interfaces\Polling\Sensors\WirelessFrequencyPolling;
use LibreNMS\OS; use LibreNMS\OS;
use LibreNMS\Util\Number;
use LibreNMS\Util\Rewrite; use LibreNMS\Util\Rewrite;
class ArubaInstant extends OS implements class ArubaInstant extends OS implements
@@ -265,7 +266,7 @@ class ArubaInstant extends OS implements
protected function decodeChannel($channel): int protected function decodeChannel($channel): int
{ {
// Trim off everything not a digit, like channel "116e" // Trim off everything not a digit, like channel "116e"
$channel = preg_replace("/\D/", '', $channel); $channel = Number::cast(preg_replace("/\D/", '', $channel));
return $channel & 255; // mask off the channel width information return $channel & 255; // mask off the channel width information
} }