Development

#4273 (Upload file form fields with field names starting with 'name' do not validate correctly)

You must first sign up to be able to contribute.

Ticket #4273 (new defect)

Opened 3 months ago

Last modified 2 months ago

Upload file form fields with field names starting with 'name' do not validate correctly

Reported by: d_akinas Assigned to: fabien
Priority: minor Milestone: 1.1.6
Component: validation Version: 1.1.2
Keywords: validation, file upload Cc:
Qualification: Accepted

Description

Example class: UploadForm.class.php

class UploadForm extends sfForm
{
  public function configure()
  {
    $this->setWidgets(array(
      'namezorger' => new sfWidgetFormInputFile(),
    ));
    
    $this->setValidators(array(
      'namezorger'   => new sfValidatorFile(),
    ));
    
    $this->widgetSchema->setNameFormat('files[%s]');
    
    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);    
  }
}

Submitting a form will result in these errors displayed:

  * Extra field typezorger.
  * Extra field tmp_namezorger.
  * Extra field errorzorger.
  * Extra field sizezorger.
  • Symfony 1.1.1
  • PHP 5.2.2
  • Apache 2.2.4
  • Win Vista

Change History

09/04/08 22:27:03 changed by fabien

  • milestone set to 1.1.2.

09/17/08 21:54:19 changed by nicolas

  • qualification changed from Unreviewed to Accepted.
  • milestone changed from 1.1.2 to 1.1.3.

This is due to a bad bad regexp ;-)

I tried for half an hour to fix it with the related pathToArray() method, but with no luck. I delay it for 1.1.2.

09/17/08 22:05:02 changed by nicolas

for 1.1.2 I mean, sorry (/me -> sleep)

09/17/08 22:05:20 changed by nicolas

WOW, 1.1.3 (doh!)

09/29/08 15:27:19 changed by nicolas

  • version changed from 1.1.1 to 1.1.2.
  • milestone changed from 1.1.3 to 1.1.4.

10/03/08 21:50:55 changed by fabien

  • milestone changed from 1.1.4 to 1.1.5.