Development

#279 (File upload array support breaks single-file uploads)

You must first sign up to be able to contribute.

Ticket #279 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

File upload array support breaks single-file uploads

Reported by: adam@cheap56k.com Assigned to:
Priority: critical Milestone:
Component: Version: 0.7.X
Keywords: Cc:
Qualification:

Description

After upgrading to 934, I found that my file upload fields no longer work. The problem involves three identical preg_match statements in the hasFile, getFileValue, and getFileValue functions under sfWebRequest.class.php.

I fixed it by changing this:

if ($name = preg_match('/(.+?)\[(.+?)\]$/', $name, $match))

to this:

if (preg_match('/(.+?)\[(.+?)\]$/', $name, $match))

If the file upload field was not an array, the original code would change the form field name to '0' when the preg_match statement failed.

Change History

03/06/06 14:47:51 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r947.