Skip to content

Commit

Permalink
Enable prefer form input filter flag by default
Browse files Browse the repository at this point in the history
- This fixes a regression in 2.2.3 via zendframework#4996, whereby the fix to a
  regression caused a new regression in behavior, in which the form
  input filters were no longer being merged in the expected order.
  Essentially, the fix in zendframework#4996 now enforced the `preferFormInputFilter`
  flag status, which was de facto enabled due to the hacks previously
  present. This flag is now enabled by default to provide the behavior
  by default (which is what was occurring before the changes, albeit via
  a different mechanism).
  • Loading branch information
weierophinney committed Aug 26, 2013
1 parent 98b5b85 commit ce07861
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Form extends Fieldset implements FormInterface
*
* @var bool
*/
protected $preferFormInputFilter = false;
protected $preferFormInputFilter = true;

/**
* Are the form elements/fieldsets wrapped by the form name ?
Expand Down
11 changes: 11 additions & 0 deletions tests/ZendTest/Form/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,9 @@ public function testInputFilterOrderOfPrecedence1()
->isRequired());
}

/**
* @group 5015
*/
public function testCanSetPreferFormInputFilterFlagViaSetOptions()
{
$flag = ! $this->form->getPreferFormInputFilter();
Expand All @@ -1649,6 +1652,9 @@ public function testCanSetPreferFormInputFilterFlagViaSetOptions()
$this->assertSame($flag, $this->form->getPreferFormInputFilter());
}

/**
* @group 5015
*/
public function testFactoryCanSetPreferFormInputFilterFlag()
{
$factory = new Factory();
Expand All @@ -1662,4 +1668,9 @@ public function testFactoryCanSetPreferFormInputFilterFlag()
$this->assertSame($flag, $form->getPreferFormInputFilter());
}
}

public function testPreferFormInputFilterFlagIsEnabledByDefault()
{
$this->assertTrue($this->form->getPreferFormInputFilter());
}
}

0 comments on commit ce07861

Please sign in to comment.