Re: cvs: php-src(PHP_4_3) / NEWS /ext/standard string.c /main rfc1867.c
| From: | Moriyoshi Koizumi | Date: | Fri, 21 Jan 2005 19:42:01 +0000 |
| Subject: | Re: cvs: php-src(PHP_4_3) / NEWS /ext/standard string.c /main rfc1867.c | ||
| References: | 1 2 3 4 5 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-30063@lists.php.net to get a copy of this message | ||
On 2005/01/22, at 1:12, 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()? BTW, - if (PG(magic_quotes_gpc)) { - s = s ? s : filename; - tmp = strrchr(s, '\''); - s = tmp > s ? tmp : s; - tmp = strrchr(s, '"'); - s = tmp > s ? tmp : s; - } I think this portion is just the unwanted one. The rest should be kept either way. MoriyoshiWhat is really confusing around this stuff, is that php_basename() is all but designed to work on the filesystem where the script is running, while the filename coming from the outside isn't necessarily given in the same scheme. For example, php_basename() is unlikely to handle a filename encoded in a different encoding than the system's. In fact, '¥¥' (0x5c) appears in the second byte of a Shift_JIS sequence, which is the most commonly used multibyte encoding in Japan.Well, there are several problems with this. On a *NIX system it is perfectly valid to have a file name with ¥ characters in it. They cause no problems for the system or the upload code. However, if things like s = strrchr(filename, '¥¥'); are done the filename is trimmed. In addition that older variant of the code would still have problem with multibyte languages unless mbstring extension was compiled & enabled.
Ilia -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php