Re: cvs: php-src(PHP_4_3) / NEWS /ext/standard string.c /main rfc1867.c

From: Date: Sat, 22 Jan 2005 13:16:49 +0000
Subject: Re: cvs: php-src(PHP_4_3) / NEWS /ext/standard string.c /main rfc1867.c
References: 1 2 3 4 5 6 7  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-30080@lists.php.net to get a copy of this message
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

« previous php.cvs (#30080) next »