Validation in autoload PHP 4 (Fix suggested) |
[eluser]Seppo[/eluser]
This is an old bug... It has been reported many times, and currently it´s in the tracker with the ID 3175 The original problem is that in the view you get an empty error_string even if the validation fails. Tracking it down, I found out that the problem was that PHP was generating a copy of the autoloaded class, so they were different in the controller class and in the loader class (where the $this variable point, inside the views). A quick example, to show this Code: // system/application/config/autoload.php In PHP 4 (I´ve tested this in 4.3.9 and 4.4.7) throws a notice for the undefined variable. In PHP 5 (5.0.0, 5.1.6, 5.2.5) it prints "abcde", as expected. After tracking this bug inside all core I´ve finally reached to system/libraries/Controller.php, on line 87. After $this->_ci_autoloader(); I´ve added Code: foreach (array_keys(get_object_vars($this)) as $attribute) PLEASE EVERYONE, test this on all PHP versions you can and submit the result, so we can finally fix this bug... |
Welcome Guest, Not a member yet? Register Sign In |