From: spud at nothingness dot org
Operating system: RedHat 7.2
PHP version: 4.3.2
PHP Bug Type: *Languages/Translation
Bug description: Uploaded file name truncated if accent present
Description:
------------
On a standard form upload, if the user uploads a file
with a name like "�pice.jpg" (with an acute accent on
the e), PHP reports the $_FILES[0]['name'] as "foo_e",
dropping the accent and ALL following characters,
including the suffix.
I understand the perhaps the file upload can't handle
the accented characters, but it seems incorrect to
strip off the rest of the filename, including
characters that are still legitimate.
I don't know if this is a PHP bug or not, but it seems
very limiting for non-English file uploads, where
accented characters in a filename are common.
Reproduce code:
---------------
Example: with a page like
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<form action="test.php" method="post" enctype="multipart/form-data">
<input type="file" name="upload">
<input type="submit" name="submit" value="submit">
</form>
<?
if (isset($_POST['submit'])) {
print_r($_FILES);
}
?>
upload a file named "�pice.jpg", and PHP will report the filename as "e".
Expected result:
----------------
I expect $_FILES[0]['name'] to be "�pice.jpg", or at
least "epice.jpg".
Actual result:
--------------
Filename reported as "e".
--
Edit bug report at http://bugs.php.net/?id=25004&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25004&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25004&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25004&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25004&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25004&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25004&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25004&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25004&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25004&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25004&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25004&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25004&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25004&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25004&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25004&r=gnused