php-rql icon indicating copy to clipboard operation
php-rql copied to clipboard

Add test to prevent autoloader bug

Open Geekimo opened this issue 8 years ago • 1 comments

Not testing if $val is a string before testing if it is a subclass can cause autoloader class to abnormally load a class which match string value in include directory.

Geekimo avatar Nov 20 '16 20:11 Geekimo

Spent five hours on this bug. I use Symfony's UniversalClassLoader and had a test.php file inside it which was used to do some bare test outside of the framework. But I had a variable with 'test' string inside it, then the bug came.

Geekimo avatar Nov 20 '16 20:11 Geekimo