Issues (2963)

includes/polling/os/hpvc.inc.php (1 issue)

1
<?php
2
3
// Format of sysDescr is hardware model followed by version followed by build date
4
$tempstr = substr($device['sysDescr'], 0, strrpos($device['sysDescr'], ' '));
5
$version = trim(substr($tempstr, strrpos($tempstr, ' ')));
6
$hardware = trim(substr($tempstr, 0, strrpos($tempstr, ' ')));
7
8
// Serial number is in sysName after string "VCEX"
9
$serial = substr(snmp_get($device, 'sysName.0', '-OvQ', 'SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB'), 4);
0 ignored issues
show
It seems like snmp_get($device, 'sysNa...IB:SNMP-FRAMEWORK-MIB') can also be of type false; however, parameter $string of substr() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

9
$serial = substr(/** @scrutinizer ignore-type */ snmp_get($device, 'sysName.0', '-OvQ', 'SNMPv2-MIB:HOST-RESOURCES-MIB:SNMP-FRAMEWORK-MIB'), 4);
Loading history...
10