Wedge
Public area => Bug reports => The Pub => Archived fixes => Topic started 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: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,
foreach (glob($jsdir . '/' . $id. '*' . $ext) as $del) Line 553,
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.
-
So THAT's why glob() would sometimes give errors...
-
So THAT's why glob() would sometimes give errors...
Yep, a pain to realize but atleast the workaround is quite simple.
-
There are also other issues with open_basedir like the bug in cURL I haven't fixed yet >_>
-
Also, fixed locally, thanks.
-
Committed in r1768.