Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.5.2
-
Component/s: None
-
Labels:None
Description
There are a few control panels with this issue
- APISCP
- CentovaCast
- cPanel
- Plesk
It appears in each in the tab_client_stats.pdt view file. The lines look something like this
$percent_used = ($unlimited ? 0 : round(((isset($disk['used']) ? $disk['used'] : 0)/(isset($disk['limit']) ? $disk['limit'] : null))*100, 0)); $percent_used = ($unlimited ? 0 : round(((isset($bandwidth['used']) ? $bandwidth['used'] : 0)/(isset($bandwidth['limit']) ? $bandwidth['limit'] : null))*100, 0));
But $bandwidth['limit'] and $disk['limit'] can technically be 0 and null is no a valid default for the ternary. We should use min(..., 1) to ensure a valid division.