#38245 [NEW]: File Upload Problem When magic_quotes_gpc = On
| From: | david at orangegateos dot com | Date: | Fri, 28 Jul 2006 20:39:46 +0000 |
| Subject: | #38245 [NEW]: File Upload Problem When magic_quotes_gpc = On | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-100042@lists.php.net to get a copy of this message | ||
From: david at orangegateos dot com
Operating system: Windows 2003 and IIS6.0
PHP version: 5CVS-2006-07-28 (snap)
PHP Bug Type: Scripting Engine problem
Bug description: File Upload Problem When magic_quotes_gpc = On
Description:
------------
This problem seems to be related to an older occurrence of the bug found
at http://bugs.php.net/bug.php?id=31398.
The full filename is not passed to the $_FILES[] array when submitting a
file with an apostrophe in the name.
For example: David's Image.jpg
When uploading this file, everything before and including the apostrophe
is removed so that the following will only show: s Image.jpg.
The problem occurs when I am using $_FILES['userfile']['name'] to retrieve
the original filename.
I tried todays CVS, upgrading from 5.1.4. Also, I have tried PHP 4.4.2
on Windows, and the problem occurs there as well, but not on a Linux
system. As was suggested in the previous bug report, I tried 5.0.2 and
this bug is not reproducible.
Reproduce code:
---------------
<?php echo '<h1>' . $_FILES['userfile']['name'] .
'</h1>'; ?>
<form name="fileUpload" enctype="multipart/form-data" method="post"
action="index.php">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input type="file" name="userfile" value="" /><br />
<br />
<input type="submit" name="submit" value="Upload File" />
</form>
Expected result:
----------------
The full name of the file, including the apostrophe: David's Image.jpg.
Actual result:
--------------
The first part of the filename is removed, including the apostrophe.
Displays: s Image.jpg.
--
Edit bug report at http://bugs.php.net/?id=38245&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38245&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38245&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38245&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38245&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38245&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38245&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38245&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38245&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38245&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38245&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38245&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38245&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38245&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38245&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38245&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38245&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38245&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38245&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38245&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38245&r=mysqlcfg