ID:               31891
 User updated by:  rbemrose at vgmusic dot com
 Reported By:      rbemrose at vgmusic dot com
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: Debian Linux unstable
-PHP Version:      4.3.10
+PHP Version:      4CVS-2005-02-06
 New Comment:

Fixed version number.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to