-
Bug
-
Resolution: Won't Fix
-
Minor
-
3.0.11
-
None
-
Windows 7, PHP 5.3.21, PHP 5.4.12
Path resolution for symlinks on Windows in phpbb_is_writable() ends up with a case difference on the drive letter which causes it to return false.
The case difference is caused by realpath() returning a lowercase version while tempnam() returns one with an uppercase. This only happens with symlinks, using a normal directory results in both functions returning the path with an uppercase.
In the example below, cache2 is symlinked to ./cache which is writable.
tempnam('./cache2/', 'i_w'): c:\wamp\www\phpBB3\cache\i_wA8BE.tmp
phpbb_realpath('./cache2/'): c:\wamp\www\phpBB3\cache
realpath('./cache2/'): c:\wamp\www\phpBB3\cache
tempnam(phpbb_realpath('./cache2/'), 'i_w'): C:\wamp\www\phpBB3\cache\i_wA8CE.tmp
var_dump(phpbb_is_writable('./cache2/')): boolean false
Non-symlinked:
tempnam('./cache/', 'i_w'): C:\wamp\www\phpBB3\cache\i_w4557.tmp
phpbb_realpath('./cache/'): C:\wamp\www\phpBB3\cache
realpath('./cache/'): C:\wamp\www\phpBB3\cache
tempnam(phpbb_realpath('./cache/'), 'i_w'): C:\wamp\www\phpBB3\cache\i_w4558.tmp
var_dump(phpbb_is_writable('./cache/')): boolean true