ID: 31891
Comment by: cristiano at mmp dot it
Reported By: rbemrose at vgmusic dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: Debian Linux unstable
PHP Version: 4CVS-2005-02-06
New Comment:
This is breaking lots of applications like mambo & phpcollab
Previous Comments:
------------------------------------------------------------------------
[2005-02-09 18:03:13] rbemrose at vgmusic dot com
Fixed version number.
------------------------------------------------------------------------
[2005-02-09 08:17:19] adconrad at 0c3 dot net
Note that the submitter isn't actually using 4.3.10, but rather
4.3.11-dev, as of 200502060530, as that is what's in Debian's current
php4 packages.
This DID work correctly in 4.3.10, and all previous versions, however
it was changed in CVS late in January, and bug reports filed about the
backward compatibility issue were closed as "bogus" (see, for example,
31757).
------------------------------------------------------------------------
[2005-02-09 07:15:59] rbemrose at vgmusic dot com
Description:
------------
Prior to PHP 4.3.10, paths sent as part of a file field had any
directory components sent by misbehaving browsers (IE) stripped out.
As of 4.3.10, this no longer happens, and breaks all PHP scripts
dependant on the old behavior.
As an alternative, make basename() strip Windows paths when used on
UNIX systems.
Reproduce code:
---------------
if (get_magic_quotes_gpc()) {
$filename = basename(stripslashes($_FILES['file1']['name']));
} else {
$filename = basename($_FILES['file1']['name']);
}
Expected result:
----------------
$filename should contain filename.ext
Actual result:
--------------
When IE is used, $filename contains Drive:\path\filename.ext
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31891&edit=1