[#6238] Division by zero in whups\lib\Reports.php
Summary Division by zero in whups\lib\Reports.php
Queue Whups
Type Bug
State Resolved
Priority 1. Low
Owners Chuck Hagenbuch <chuck (at) horde (dot) org>
Requester paul (dot) g (dot) roy (at) uottawa (dot) ca
Created 02/10/2008 (240 days ago)
Due
Updated 02/10/2008 (240 days ago)
Assigned
Resolved 02/10/2008 (240 days ago)
Attachments
Milestone
Patch No

History
02/10/2008 Chuck Hagenbuch Comment #2
State ⇒ Resolved
Assigned to Chuck Hagenbuch
Reply to this comment
Fixed in CVS, thanks!
02/10/2008 paul (dot) g (dot) roy (at) uottawa (dot) ca Comment #1
Queue ⇒ Whups
Summary ⇒ Division by zero in whups\lib\Reports.php
Type ⇒ Bug
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Reply to this comment
The math operations in lines 186 to 193 should be wrapped in if-else 
statements in the event the dataset contains 0 tickets:

[10-Feb-2008 15:45:28] PHP Warning:  Division by zero in 
\ssms\whups\lib\Reports.php on line 192

[10-Feb-2008 15:45:28] PHP Warning:  max() [<a 
href='function.max'>function.max</a>]: Array must contain atleast one 
element in \ssms\whups\lib\Reports.php on line 189

[10-Feb-2008 15:45:28] PHP Warning:  min() [<a 
href='function.min'>function.min</a>]: Array must contain atleast one 
element in \ssms\whups\lib\Reports.php on line 189

Versions:
whups/lib/Reports.php,v 1.32 2008/01/02
Horde 4.0 cvs retrieved Feb 9/2008