Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Sep 22, 2017
Merged

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

merged 1 commit into from Sep 22, 2017

Conversation

lamaral
Copy link
Contributor

@lamaral lamaral commented Sep 22, 2017

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.

@dg9vh dg9vh merged commit 4a3480c into dg9vh:master Sep 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants