Jump to content

ACARS.php problem


michael Kraan

Recommended Posts

I have found 2 erros in my error log:

[29-Jan-2014 21:00:29 Europe/London] PHP Warning: Division by zero in /home/flyairli/public_html/core/modules/ACARS/ACARS.php on line 85

[29-Jan-2014 21:00:29 Europe/London] PHP Warning: Division by zero in /home/flyairli/public_html/core/modules/ACARS/ACARS.php on line 94

This is line 85: $percomplete = ABS(number_format(((($totaldistance - $flight->distremain) / $totaldistance) * 100 ), 2));

and

This is line 94: $percomplete = ABS(number_format(((($totaldistance - $flight->distremain) / $totaldistance) * 100), 2));

i hope there is a fix for that, i get this error every 5 seconds in the error_log

Link to comment
Share on other sites

  • Members

somebody send's a zero to this variable and as you know from school 0 cannot be devided

you should insert a check control

for exaple

if zero

return false

else

do the calculation

also what i do not understand is why you have 2 variables with the same name doing the same thing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...