On 2005/01/22, at 4:50, Ilia Alshanetsky wrote:
Moriyoshi Koizumi wrote:Right, but the browsers send filenames in its particular form, whose
path delimiter could be '\\'. Isn't this causing another problem on
a *NIX system where '\\' isn't regarded as a delimiter by php_basename()?
No, browsers send filenames however they like, we cannot assume anything
since ultimately someone could doctor a request. On *NIX, \ would be
ignored and continue being part of the filename. In effect keeping the
original supplied file name in play.
While the above statement is perfectly valid, yet it cannot be a reason to use
php_basename() there, because the function also makes an inappropriate
assumption that given pathes are all in a platform specific form (not saying
that php_basename() itself works wrongly but is abused here). What if the
server is running on a *nix and the submitted filename is somewhat like
"c:\windows\system32\what_is_this"?? Resulting filename was always the last
component of the path on every system prior to your fix.
Moriyoshi
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php