php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2626 Incorrectly sets upload file variables when file name variable is in an array
Submitted: 1999-10-27 18:53 UTC Modified: 2000-08-06 09:22 UTC
From: c_stach at yahoo dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: Linux (RedHat 6.1)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: c_stach at yahoo dot com
New email:
PHP Version: OS:

 

 [1999-10-27 18:53 UTC] c_stach at yahoo dot com
    When using an HTTP form to upload files PHP incorrectly sets the <variable>_size, <variable>_type, and neglects to set <variable>_name variables when <variable> is in the format of an array (eg, "userfile[$index]" which would expand to something like "userfile[3]").  What actually ends up happening, for example, is userfile[3]_name is not ever set, userfile[3]_type is set correctly, and userfile_size is set to the last encountered size value instead of userfile[3]_size.

    Beyond this problem, I ran into another issue with this.  PHP seemingly incorrectly parses out, for example, a variable in the format "$userfile[$id]_name" which led me to have to do "${userfile[$id]_name"} instead to get around the constraints of the parser.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-10-28 12:55 UTC] c_stach at yahoo dot com
Instead of  "${userfile[$id]_name"} in the last paragraph, I actually meant ${"userfile[$id]_name"}.

 [2000-08-06 09:22 UTC] rasmus@php.net
This has been fixed in PHP 4
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 03:01:28 2025 UTC