Warning issued on first load of install tool
On first load of the install tool from the BE interface the following warning is issued. This was introduced with 4.2.10
Warning: Invalid argument supplied for foreach() in /path/to/TYPO3_4-2-10/typo3/sysext/install/mod/class.tx_install_session.php on line 349
debug(glob($sessionSavePath . '/hash_*'));
The warning vanishes if the install tool is selected a second time (when a hash_* file is existing).
This also happens always if I change the installTollPassword on first load.
(issue imported from #M12371)
#1 Updated by Ernesto Baschny over 10 years ago
I am not able to reproduce that. The "hash_" file is created as soon as I first hit the install tool, so there is always one there. Even when changing the password, it creates a new "session*" dir and a hash_* file inside.
Could you try to figure out how you could reproduce that and give more detailed steps?
#3 Updated by Ernesto Baschny over 10 years ago
Ok, the problem is that glob() seems to be returning false in your case, while it returns an empty array for me in this situation, thus never entering in this warning situation.
What PHP version are you running and which OS?
php.net docs on "glob()" say:
"Returns an array containing the matched files/directories, an empty array if no file matched or FALSE on error."
and also "Note: On some systems it is impossible to distinguish between empty match and an error. "
So it might be easier to just make sure it is an array before continuing just to be safe. Please try attached patch (for trunk) to see if it fixes your problem.
#4 Updated by Christian Kuhn over 10 years ago
Yep, patch fixed this.
The system is a std. debian lenny php package (php5-cgi/lenny uptodate 5.2.6.dfsg.1-1+lenny3) with suhosin, reverse proxy, open_basedir and eaccelerator.
Reading http://bugs.php.net/bug.php?id=47358 there seems to be a problem with return value of glob() in open_basedir environments. This is probably the root of all evil and your patch happily takes care of this. Thanks :)