PHP Bug – glob(), GLOB_BRACE, and Windows paths

I stumbled upon a PHP framework called Kohana, which is based on CodeIgniter. I’ve used CI a bit in the past and thought I’d give Kohana a whirl. I downloaded the latest code and tried to run it on a Windows XP machine.

Well, when I brought up the site, I got an error:

Fatal error: Unable to locate the requested file, log.php in <system_path>/system/core/Kohana.php on line 408

After a lot of digging, I found that there was a glob() call that was not behaving correctly. I narrowed it down to what I believe to be a bug in PHP with the glob() function, using the GLOB_BRACE flag, and using a pattern that includes a colon (as in {c:/firstFolderToCheck,c:/secondFolderToCheck}).

Assuming it turns out to be valid, I’m surprised that it hasn’t been found/reported before…

2 thoughts on “PHP Bug – glob(), GLOB_BRACE, and Windows paths”

Comments are closed.

Scroll to Top