#33918 [Opn->Csd]: File uploads: apostrophes cause filename to be incorrectly reported
| From: | sniper@php.net | Date: | Fri, 29 Jul 2005 13:28:51 +0000 |
| Subject: | #33918 [Opn->Csd]: File uploads: apostrophes cause filename to be incorrectly reported | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82664@lists.php.net to get a copy of this message | ||
ID: 33918
Updated by: sniper@php.net
Reported By: lewis dot peckover at m-w dot co dot uk
-Status: Open
+Status: Closed
Bug Type: Unknown/Other Function
Operating System: all?
PHP Version: 5.0.4
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-07-29 15:08:29] lewis dot peckover at m-w dot co dot uk
Description:
------------
Any file uploaded that has a name containing an apostrophe ('), eg
foo'bar.txt, will be incorrectly named in the $_FILES array. It will
ignore all characters up to and including the apostrophe.
foo'bar.txt -> bar.txt
Tested on PHP 4.3.10/Apache/FreeBSD 5.3 and PHP 5.0.4/IIS/Windows 2003.
Reproduce code:
---------------
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post"
enctype="multipart/form-data">
<input type="file" name="file"><input type="submit">
</form>
<pre>
<?php
print_r($_FILES);
?></pre>
</body>
</html>
Expected result:
----------------
Array
(
[file] => Array
(
[name] => foo'bar.txt
[type] => text/plain
[tmp_name] => d:\PHP\uploadtemp\php9B1.tmp
[error] => 0
[size] => 9
)
)
Actual result:
--------------
Array
(
[file] => Array
(
[name] => bar.txt
[type] => text/plain
[tmp_name] => d:\PHP\uploadtemp\php9B1.tmp
[error] => 0
[size] => 9
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33918&edit=1