From 8f0a996a76245619c86c4b4807628ff927e1f723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20H=C3=BCbel?= Date: Sun, 3 May 2020 22:05:51 +0100 Subject: [PATCH] Some bugfixes with PHP-Warnings --- ajax.php | 4 ++-- include/tools.php | 11 +++-------- version.php | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ajax.php b/ajax.php index 73aafea..9272889 100644 --- a/ajax.php +++ b/ajax.php @@ -223,11 +223,11 @@ if ($_GET['section'] == "sysinfo") { showLapTime("cpuusage"); $output = shell_exec('grep -c processor /proc/cpuinfo'); - $cpucores = $output; + $cpucores = intval($output); $output = shell_exec('cat /proc/uptime'); $uptime = format_time(substr($output,0,strpos($output," "))); - $idletime = format_time((substr($output,strpos($output," ")))/$cpucores); + $idletime = format_time(doubleval((substr($output,strpos($output," "))))/$cpucores); showLapTime("idletime"); if (defined("SHOWPOWERSTATE")) { diff --git a/include/tools.php b/include/tools.php index 204436f..a918203 100644 --- a/include/tools.php +++ b/include/tools.php @@ -1,5 +1,7 @@ - -