cast string to float for memory usage shell_exec call (#6626)

Co-authored-by: Tim Fry <tim@voipstratus.com>
This commit is contained in:
frytimo
2023-04-26 23:26:53 -03:00
committed by GitHub
parent a9908cb745
commit 81d3adbd35

View File

@@ -137,7 +137,7 @@
if (stristr(PHP_OS, 'Linux')) {
$free = shell_exec("/usr/bin/which free");
$awk = shell_exec("/usr/bin/which awk");
$percent_memory = round(shell_exec(escapeshellcmd($free." | ".$awk." 'FNR == 3 {print $3/($3+$4)*100}'")), 1);
$percent_memory = round((float)shell_exec(escapeshellcmd($free." | ".$awk." 'FNR == 3 {print $3/($3+$4)*100}'")), 1);
if ($percent_memory != '') {
echo "<tr class='tr_link_void'>\n";
echo "<td valign='top' class='".$row_style[$c]." hud_text'>".$text['label-memory_usage']."</td>\n";