[eluser]ccw39[/eluser]
So, I was looking through my log files to figure out why I'm having a problem with my site. I randomly noticed that, on form validation when I have form errors, the last log message involving that form is incorrect. Basically, it's attaching the wrong error to the very last field that was validated.
Line 386 in Validation.php is about where the problems are happening (this is in the run() function)
Notice how that line is outputing the $field variable. However, from the looks of it, the $field variable was created way back near the top of the run() function during a foreach loop on line 210: "foreach ($this->_rules as $field => $rules)". However, the right curly bracket on line 358 closes that particular foreach function. Thus, by time line 386 sees the $field variable, I think it's getting the last value of $field from the foreach loop (which, oddly enough, isn't out of scope here for some reason, although it seems like it should).
Anyway, by time line 386 comes around, the log is incorrectly displaying
ALL the validation errors and saying they are attributed to the very last value of $field from that foreach loop.
So, if you see what I mean, please let me know. I just wanted to bring it to your attention.
I'm running PHP 5.2.3 with Code Igniter 1.5.3 on Windows with Apache 2.2.4.