Merge pull request #11877 from murrant/remove-str-i-usage

Fix some str_i_contains() usages
This commit is contained in:
Tony Murray
2020-06-29 22:33:49 -05:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -25,6 +25,7 @@
namespace LibreNMS\OS;
use Illuminate\Support\Str;
use LibreNMS\Device\WirelessSensor;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
use LibreNMS\OS;
@@ -41,7 +42,7 @@ class Symbol extends OS implements WirelessClientsDiscovery
{
$device = $this->getDevice();
if (str_i_contains($device['hardware'], 'AP')) {
if (Str::contains(strtolower($device['hardware']), 'ap')) {
$oid = '.1.3.6.1.4.1.388.11.2.4.2.100.10.1.18.1';
return array(
new WirelessSensor('clients', $device['device_id'], $oid, 'symbol', 1, 'Clients')

View File

@@ -4,7 +4,7 @@ namespace App\Models;
use DB;
use Illuminate\Database\Eloquent\Builder;
use LibreNMS\Data\Store\Rrd;
use Illuminate\Support\Str;
use LibreNMS\Util\Rewrite;
use Permissions;
@@ -72,7 +72,7 @@ class Port extends DeviceRelatedModel
}
foreach ((array)\LibreNMS\Config::get('rewrite_if', []) as $src => $val) {
if (str_i_contains($label, $src)) {
if (Str::contains(strtolower($label), strtolower($src))) {
$label = $val;
}
}