Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: Anthony` on November 4th, 2012, 07:15 PM

Title: open_basedir and Cache Errors
Post by: Anthony` on November 4th, 2012, 07:15 PM
Looks like there is another open_basedir issue here (this setting is quite a pain in the arse)...

I noticed I had 4 errors in the error log after installing Wedge:
Quote
2: Invalid argument supplied for foreach()
File: /home/projecte/public_html/dexterslab/wedge/Sources/Subs-Cache.php
Line: 766

2: Invalid argument supplied for foreach()
File: /home/projecte/public_html/dexterslab/wedge/Sources/Subs-Cache.php
Line: 553
Line 766,
Code: [Select]
foreach (glob($jsdir . '/' . $id. '*' . $ext) as $del)
Line 553,
Code: [Select]
foreach (glob($final_folder . '/' . ($id ? $id . '-*' : '[0-9]*') . $ext) as $del)

The open_basedir setting on my host does have a value according to phpinfo(). Resetting the file cache reproduced these errors, so it seems iterating through the cached CSS and JS files are a problem.

After looking at this,
https://bugs.php.net/bug.php?id=47358

It seems glob() is returning boolean false rather than an empty array. Obvious fix: check beforehand whether it's false and if so make it an empty array.

Title: Re: open_basedir and Cache Errors
Post by: live627 on November 4th, 2012, 10:38 PM
So THAT's why glob() would sometimes give errors...
Title: Re: open_basedir and Cache Errors
Post by: Anthony` on November 4th, 2012, 11:22 PM
Quote from live627 on November 4th, 2012, 10:38 PM
So THAT's why glob() would sometimes give errors...
Yep, a pain to realize but atleast the workaround is quite simple.
Title: Re: open_basedir and Cache Errors
Post by: Arantor on November 4th, 2012, 11:31 PM
There are also other issues with open_basedir like the bug in cURL I haven't fixed yet >_>
Title: Re: open_basedir and Cache Errors
Post by: Arantor on November 5th, 2012, 12:34 AM
Also, fixed locally, thanks.
Title: Re: open_basedir and Cache Errors
Post by: Arantor on November 5th, 2012, 01:29 AM
Committed in r1768.