Jump to content
michael Kraan

ACARS.php problem

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×