Req #31891 [Opn->Dup]: Revert $_FILES['file']['name'] behavior

From: Date: Mon, 23 Mar 2015 19:28:03 +0000
Subject: Req #31891 [Opn->Dup]: Revert $_FILES['file']['name'] behavior
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191553@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=31891&edit=1 ID: 31891 Updated by: cmb@php.net Reported by: rbemrose at vgmusic dot com Summary: Revert $_FILES['file']['name'] behavior -Status: Open +Status: Duplicate Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: Debian Linux unstable PHP Version: 4CVS-2005-02-06 Block user comment: N Private report: N New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2005-02-16 19:40:48] cristiano at mmp dot it This is breaking lots of applications like mambo & phpcollab ------------------------------------------------------------------------ [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 https://bugs.php.net/bug.php?id=31891&edit=1

« previous php.bugs (#191553) next »