mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Use empty() instead of isset() and PHP's implicit boolean conversion
This commit is contained in:
@ -157,10 +157,10 @@ function getImageSrc($device) {
|
||||
|
||||
$device['os'] = strtolower($device['os']);
|
||||
|
||||
if ($device['icon'] && file_exists($config['html_dir'] . "/images/os/" . $device['icon'] . ".png")) {
|
||||
if (!empty($device['icon']) && file_exists($config['html_dir'] . "/images/os/" . $device['icon'] . ".png")) {
|
||||
$image = $config['base_url'] . '/images/os/' . $device['icon'] . '.png';
|
||||
}
|
||||
elseif (isset($config['os'][$device['os']]['icon']) && $config['os'][$device['os']]['icon'] && file_exists($config['html_dir'] . "/images/os/" . $config['os'][$device['os']]['icon'] . ".png")) {
|
||||
elseif (!empty($config['os'][$device['os']]['icon']) && file_exists($config['html_dir'] . "/images/os/" . $config['os'][$device['os']]['icon'] . ".png")) {
|
||||
$image = $config['base_url'] . '/images/os/' . $config['os'][$device['os']]['icon'] . '.png';
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user