alexandermarston / vnstat-dashboard

A responsive web UI to view network traffic statistics provided by vnStat (with support for version 2.x)
https://alexandermarston.github.io/vnstat-dashboard/
142 stars 60 forks source link

#17 Fix PHP notice caused by uninitialized $i variable #18

Closed piotrmacha closed 5 years ago

alexandermarston commented 5 years ago

Thank you for contributing, @piotrmacha

This doesn't fix the issue, unfortunately. You're setting $i to 0 at the beginning of each iteration which means $i can only ever be 1 - this causes an issue with the array building as $i is used as an index.

piotrmacha commented 5 years ago

Yes, you are right. That was stupid mistake caused by lack of focus. I moved the initialization before loop.