From 5457855aa148eb7513c4169b1b805b41cfa43911 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 3 Sep 2023 09:46:50 +0200 Subject: [PATCH] Unambiguously typecast to expected datatype --- ajax/networking/get_frequencies.php | 1 + app/lib/system.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ajax/networking/get_frequencies.php b/ajax/networking/get_frequencies.php index 7fb29990..28d5ecd2 100644 --- a/ajax/networking/get_frequencies.php +++ b/ajax/networking/get_frequencies.php @@ -9,6 +9,7 @@ if (isset($_POST['interface'])) { define( 'NL80211_BAND_24GHZ', 0x1 ); define( 'NL80211_BAND_5GHZ', 0x2 ); $iface = escapeshellcmd($_POST['interface']); + $flags = 0; // get physical device for selected interface exec("iw dev | awk '/$iface/ {print line}{line = $0}'", $return); diff --git a/app/lib/system.php b/app/lib/system.php index a0aeb51d..676c2201 100644 --- a/app/lib/system.php +++ b/app/lib/system.php @@ -49,7 +49,7 @@ class Sysinfo public function usedMemory() { $used = shell_exec("free -m | awk 'NR==2{ total=$2 ; used=$3 } END { print used/total*100}'"); - return floor($used); + return floor(intval($used)); } public function processorCount()