dg9vh / YSFReflector-Dashboard

Dashboard for YSFReflector (by G4KLX)
Creative Commons Zero v1.0 Universal
35 stars 37 forks source link

Fix undefined offset errors in functions.inc.php. #5

Closed lamaral closed 7 years ago

lamaral commented 7 years ago

When accessing the dashboard on my server, I noticed that many times I was getting the following errors on my server log:

PHP Notice:  Undefined offset: 6 in /var/www/ysf/include/functions.php on line 98
PHP Notice:  Undefined offset: 6 in /var/www/ysf/include/functions.php on line 108

I noticed you just used the count() function to get the values for the loop, making the array go out of bounds, as the array counts from 0 to total-1 and the count() function was returning the total.

The propsed fix uses count()-1 instead of count() and fixed the problem in my environment.