Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function createInputFilter($inputFilterSpecification)

$type = 'Zend\InputFilter\InputFilter';

if (isset($inputFilterSpecification['type'])) {
if (isset($inputFilterSpecification['type']) && is_string($inputFilterSpecification['type'])) {
$type = $inputFilterSpecification['type'];
unset($inputFilterSpecification['type']);
}
Expand Down
16 changes: 16 additions & 0 deletions test/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,20 @@ public function testFactoryWillNotGetPrioritySetting()
$index++;
}
}

public function testConflictNameWithInputFilterType()
{
$factory = new Factory();

$inputFilter = $factory->createInputFilter(
array(
'type' => array(
'required' => true
)
)
);

$this->assertInstanceOf('Zend\InputFilter\InputFilter', $inputFilter);
$this->assertTrue($inputFilter->has('type'));
}
}

0 comments on commit 75a28c0

Please sign in to comment.