#31503 [Opn->Bgs]: $_FILES array returns incorrect values
| From: | derick@php.net | Date: | Wed, 12 Jan 2005 08:11:31 +0000 |
| Subject: | #31503 [Opn->Bgs]: $_FILES array returns incorrect values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71927@lists.php.net to get a copy of this message | ||
ID: 31503
Updated by: derick@php.net
Reported By: mail1 at prettyworthless dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: FreeBSD
PHP Version: 4.3.10
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
Duplicate of bug #31398
Previous Comments:
------------------------------------------------------------------------
[2005-01-12 03:00:29] mail1 at prettyworthless dot com
Description:
------------
If I create an input type=files in the html form
Then in the target php script use the $_FILES array to get the info
All works well - uploads work fine.
But . . . if the file name contains a single quote mark, the name from
$_FILES is not correct. The resulting $_FILES['file']['name'] gives the
name from the next character after the single quote to the end (like a
reverse truncation). Only the single quote casues this (that I have
found). The upload still works, but with a wierd file name result.
Went back and tested with 4.3.4 and it works correctly.
Reproduce code:
---------------
html upload page (test.htm):
<form action="test.php" method="post"
enctype="multipart/form-data">
File: <input type=file name="file" size=30><br>
<input type=submit name="submit" value="Upload File"></form>
php processing page (test.php):
<?php
print_r($_FILES);
?>
Then try and use any file name with a single quote in it.
Expected result:
----------------
$_FILES['file']['name'] should have the file name - such as
abcd'efg.txt
Actual result:
--------------
$_FILES['file']['name'] will have the cut-off name - such as efg.txt
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31503&edit=1