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

September 2nd, 2007

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…

Bookmark: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Technorati
  • StumbleUpon
  • Reddit
  • Ma.gnolia
  • Facebook
  • Furl
  • Fark
  • Google
  • Slashdot

Tags: , , ,

2 Responses to “PHP Bug - glob(), GLOB_BRACE, and Windows paths”

  1. Wahoo

    Thank you for sharing!

  2. Tasarim

    wow great share thanks for the info…

Leave a Reply

If you'd like to post code in your comment, please wrap your code with a pre and code tag. For example, <pre><code>CODE</code></pre>. Additionally, you'll need to escape the HTML entities (try Postable), otherwise the code will not display properly.