From:             rbemrose at vgmusic dot com
Operating system: Debian Linux unstable
PHP version:      4.3.10
PHP Bug Type:     Feature/Change Request
Bug description:  Revert $_FILES['file']['name'] behavior

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 bug report at http://bugs.php.net/?id=31891&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31891&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31891&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31891&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31891&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31891&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31891&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31891&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31891&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31891&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31891&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31891&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31891&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31891&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31891&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31891&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31891&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31891&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31891&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31891&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31891&r=mysqlcfg

Reply via email to