mirror of
https://github.com/unraid/webgui.git
synced 2026-01-25 02:58:58 -06:00
PHP 8.1 support (round 2)
This commit is contained in:
@@ -190,7 +190,7 @@ function device_smart(&$disk, &$fail, &$smart) {
|
||||
exec("awk 'NR>7{print $1,$2,$4,$6,$9,$10}' ".escapeshellarg($file)." 2>/dev/null", $codes);
|
||||
foreach ($codes as $code) {
|
||||
if (!$code || !is_numeric($code[0])) continue;
|
||||
[$id,$class,$value,$thres,$when,$raw] = explode(' ',$code);
|
||||
[$id,$class,$value,$thres,$when,$raw] = my_explode(' ',$code,7);
|
||||
$failing = strpos($when,'FAILING_NOW')!==false;
|
||||
if (!$failing && !in_array($id,$events)) continue;
|
||||
if ($failing || ($select ? $thres>0 && $value<=$thres*$level : $raw>0)) $title .= normalize($class,$failing?$when:$raw);
|
||||
|
||||
@@ -118,7 +118,7 @@ function geturls_certdetails($file, $hostname, $ip="") {
|
||||
$data = implode("\n", $data);
|
||||
// determine cn
|
||||
preg_match('/ *commonName *= (.*)/', $data, $matches);
|
||||
$cn = trim($matches[1]);
|
||||
$cn = trim($matches[1]??'');
|
||||
if (strpos($cn, ".myunraid.net") !== false) {
|
||||
$type = 'myunraid.net';
|
||||
$iphost = str_replace('.','-',$ip);
|
||||
@@ -136,7 +136,7 @@ function geturls_certdetails($file, $hostname, $ip="") {
|
||||
// replace wildcard with hostname
|
||||
$cn = str_replace('*', $hostname, $cn);
|
||||
$cn_priv = $cn;
|
||||
if (strpos($data, "Self-signed") !== false){
|
||||
if (strpos($data??'', "Self-signed") !== false){
|
||||
$type = 'self-signed';
|
||||
} else {
|
||||
$type = 'user-provided';
|
||||
@@ -471,7 +471,7 @@ foreach ($devices as $device) {
|
||||
|
||||
// create pool btrfs information
|
||||
foreach ($pools as $pool) {
|
||||
if (strpos($disks[$pool]['fsType'],'btrfs')!==false) {
|
||||
if (strpos($disks[$pool]['fsType']??'','btrfs')!==false) {
|
||||
run("echo 'Pool: $pool'|todos >>".escapeshellarg("/$diag/system/btrfs-usage.txt"));
|
||||
run("/sbin/btrfs filesystem usage -T /mnt/$pool 2>/dev/null|todos >>".escapeshellarg("/$diag/system/btrfs-usage.txt"));
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ function check_smart(&$disk,$port,$text,$info) {
|
||||
$item = 'smart';
|
||||
foreach ($codes as $code) {
|
||||
if (!$code || !is_numeric($code[0])) continue;
|
||||
[$id,$class,$value,$thres,$when,$raw] = explode(' ',$code);
|
||||
[$id,$class,$value,$thres,$when,$raw] = my_explode(' ',$code,7);
|
||||
$fail = strpos($when,'FAILING_NOW')!==false;
|
||||
if (!$fail && !in_array($id,$events)) continue;
|
||||
$word = str_replace(['_',' (-)'],[' ',''],strtolower("$class ($when)"));
|
||||
|
||||
Reference in New Issue
Block a user