zendframework/zend-inputfilter
Abandoned; use laminas/laminas-inputfilter. Normalize and validate input sets from the web, APIs, the CLI, and more, including files
2.10.1
16M downloads/mo
#4111 most downloaded on Packagist
zendframework/zend-inputfilter
What this package is like to depend on
Last release 7 years ago
no release in 18 months
Release timing varies
gaps range from 3 weeks to 9 months
Some releases are documented
notes for 25 of 81 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
81 releases · first in 2012
0 releases in the last 12 months
see the full history below
Release timeline
52 releases · Oct 2012 to Aug 2019Releases
latest 60 of 81-
2.10.128 Aug 2019Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#185 fixes validation response on invalid file upload request.
-
#181 fixes missing abstract service factory registration in
Moduleas per the latest documentation. In particular, it ensures that theInputFilterAbstractFactoryis registered under theinput_filtersconfiguration. -
#180 fixes attaching validators on creation of InputFilter -
priorityvalue is now used.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#185 fixes validation response on invalid file upload request.
-
#181 fixes missing abstract service factory registration in
Moduleas per the latest documentation. In particular, it ensures that theInputFilterAbstractFactoryis registered under theinput_filtersconfiguration. -
#180 fixes attaching validators on creation of InputFilter -
priorityvalue is now used.
-
2.10.030 Jan 2019Release notes
Open source →Added
-
#176 adds the interface
UnfilteredDataInterface, with the following methods:public function getUnfilteredData() : array|object; public function setUnfilteredData(array|object $data) : $this;
By default, the
BaseInputFilternow implements this interface.The primary purpose of the interface is to allow the ability to access ALL
original raw data, and not just the data the input filter knows about. This is
particularly useful with collections.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
Release notes
Open source →Added
-
#176 adds the interface
UnfilteredDataInterface, with the following methods:public function getUnfilteredData() : array|object; public function setUnfilteredData(array|object $data) : $this;By default, the
BaseInputFilternow implements this interface.The primary purpose of the interface is to allow the ability to access ALL original raw data, and not just the data the input filter knows about. This is particularly useful with collections.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
-
-
2.9.107 Jan 2019Release notes
Open source →Added
- #174 adds support for PHP 7.3.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #175 fixes a regression introduced in 2.9.0 when overriding the default
validator of aFileInput. 2.9.0 changed the default to use the
fully-qualified class name ofZend\Validator\File\Uploadas the service,
instead of the previous 'fileuploadfile`; this release returns to the original
behavior.
Release notes
Open source →Added
- #174 adds support for PHP 7.3.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #175 fixes a regression introduced in 2.9.0 when overriding the default
validator of a
FileInput. 2.9.0 changed the default to use the fully-qualified class name ofZend\Validator\File\Uploadas the service, instead of the previous 'fileuploadfile`; this release returns to the original behavior.
-
2.9.017 Dec 2018Release notes
Open source →Added
-
#172 adds support for PSR-7
UploadedFileInterfacetoZend\InputFilter\FileInput.
It adds a new interface,Zend\InputFilter\FileInput\FileInputDecoratorInterface,
which defines methods required for validating and filtering file uploads. It
also provides two implementations of it, one for standard SAPI file uploads,
and the other for PSR-7 uploads. TheFileInputclass does detection on the
value being tested and decorates itself using the appropriate decorator, which
then performs the work of validating and filtering the upload or uploads. -
#170 adds the ability to set a "required" message on a
CollectionInputFilter.
By default, such instances will lazy-load aNotEmptyvalidator, and use its
messages to report that the collection was empty if it is marked as required.
If you wish to set a different message, you have two options:-
provide a custom
NotEmptyvalidator via the new method
setNotEmptyValidator(). -
if using a factory, provide the key
required_messageas a sibling to
required, containing the custom message. This will replace the typical
IS_EMPTYmessage.
-
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
Release notes
Open source →Added
-
#172 adds support for PSR-7
UploadedFileInterfacetoZend\InputFilter\FileInput. It adds a new interface,Zend\InputFilter\FileInput\FileInputDecoratorInterface, which defines methods required for validating and filtering file uploads. It also provides two implementations of it, one for standard SAPI file uploads, and the other for PSR-7 uploads. TheFileInputclass does detection on the value being tested and decorates itself using the appropriate decorator, which then performs the work of validating and filtering the upload or uploads. -
#170 adds the ability to set a "required" message on a
CollectionInputFilter. By default, such instances will lazy-load aNotEmptyvalidator, and use its messages to report that the collection was empty if it is marked as required. If you wish to set a different message, you have two options:-
provide a custom
NotEmptyvalidator via the new methodsetNotEmptyValidator(). -
if using a factory, provide the key
required_messageas a sibling torequired, containing the custom message. This will replace the typicalIS_EMPTYmessage.
-
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
-
-
2.8.313 Dec 2018Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #167 fixes the combination of marking an
ArrayInputrequired, and passing an
empty array for validation; it now correctly detects these as invalid.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #167 fixes the combination of marking an
ArrayInputrequired, and passing an empty array for validation; it now correctly detects these as invalid.
-
2.8.214 May 2018Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#163 adds code to
BaseInputFilter::populate()to detect non-iterable,
non-null values passed as a value for a composed input filter. Previously, these would trigger
an exception; they now instead result in an empty array being used to populate the
input filter, which will generally result in invalidation without causing an
exception. -
#162 fixes incorrect abstract service factory registration in
ConfigProvideras per
the latest documentation. In particular, it ensures that theInputFilterAbstractFactory
is registered under theinput_filtersconfiguration instead of the
dependenciesconfiguration.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#163 adds code to
BaseInputFilter::populate()to detect non-iterable, non-null values passed as a value for a composed input filter. Previously, these would trigger an exception; they now instead result in an empty array being used to populate the input filter, which will generally result in invalidation without causing an exception. -
#162 fixes incorrect abstract service factory registration in
ConfigProvideras per the latest documentation. In particular, it ensures that theInputFilterAbstractFactoryis registered under theinput_filtersconfiguration instead of thedependenciesconfiguration.
-
2.8.122 Jan 2018Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#160 adds zend-servicemanager as a direct requirement, rather than a suggestion. The package has not worked without it since #67 was merged for the 2.6.1 release.
-
#161 fixes an issue whereby an input filter receiving a
nullvalue tosetData()would raise an exception, instead of being treated as an empty data set.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#160 adds zend-servicemanager as a direct requirement, rather than a suggestion. The package has not worked without it since #67 was merged for the 2.6.1 release.
-
#161 fixes an issue whereby an input filter receiving a
nullvalue tosetData()would raise an exception, instead of being treated as an empty data set.
-
2.8.004 Dec 2017Release notes
Open source →Added
-
#135 adds
Zend\InputFilter\OptionalInputFilter, which allows defining optional sets of data. This acts like a standard input filter, but is considered valid if no data,nulldata, or empty data sets are provided to it; if a non-empty data set is provided, it will run normal validations. -
#142 adds support for PHP 7.2.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- #142 removes support for HHVM.
Fixed
- Nothing.
Release notes
Open source →Added
-
#135 adds
Zend\InputFilter\OptionalInputFilter, which allows defining optional sets of data. This acts like a standard input filter, but is considered valid if no data,nulldata, or empty data sets are provided to it; if a non-empty data set is provided, it will run normal validations. -
#142 adds support for PHP 7.2.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- #142 removes support for HHVM.
Fixed
- Nothing.
-
-
2.7.604 Dec 2017Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #156 fixes an issue introduced in 2.7.5 whereby the filter and validator chains composed in inputs pulled from the
InputFilterPluginManagerwere not receiving the default filter and validator plugin manager instances. A solution was created that preserves the original behavior as well as the bugfix that created the regression.
Release notes
Open source →Added
- Nothing.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #156 fixes an
issue introduced in 2.7.5 whereby the filter and validator chains composed in
inputs pulled from the
InputFilterPluginManagerwere not receiving the default filter and validator plugin manager instances. A solution was created that preserves the original behavior as well as the bugfix that created the regression.
-
2.7.507 Nov 2017Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#151 fixes an issue in
Factory::createInput()introduced in #2 whereby an input pulled from the input filter manager would be injected with the default filter and validator chains, overwriting any chains that were set during instantiation and/orinit(). They are now never overwritten. -
#149 fixes an issue with how error messages for collection input field items were reported; previously, as soon as one item in the collection failed, the same validation message was propagated to all other items. This is now resolved.
-
#131 fixes a regression introduced in version 2.2.6 within
BaseInputFilter::setValidatorGroup()whereby it began emitting exceptions if a given input was not an input filter. This raises issues when mixing input filters and inputs in the same validator group specification, as you will generally provide the input names as keys instead of values. The patch provide ensures both styles work going forwards.
Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#151 fixes an issue in
Factory::createInput()introduced in #2 whereby an input pulled from the input filter manager would be injected with the default filter and validator chains, overwriting any chains that were set during instantiation and/orinit(). They are now never overwritten. -
#149 fixes an issue with how error messages for collection input field items were reported; previously, as soon as one item in the collection failed, the same validation message was propagated to all other items. This is now resolved.
-
#131 fixes a regression introduced in version 2.2.6 within
BaseInputFilter::setValidatorGroup()whereby it began emitting exceptions if a given input was not an input filter. This raises issues when mixing input filters and inputs in the same validator group specification, as you will generally provide the input names as keys instead of values. The patch provide ensures both styles work going forwards.
-
2.7.418 May 2017Release notes
Open source →Added
- Nothing.
Changes
- #122 maps the
Zend\InputFilter\InputFilterPluginManagerservice toZend\InputFilter\InputFilterPluginManagerFactory, and adds an alias fromInputFitlerPluginManagerto the fully qualified class name. This change allows you to request the service using either the original short name, or the fully qualified class name.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #137 fixes how the
InputFilterPluginManagerFactoryfactory initializes the plugin manager instance, ensuring it is injecting the relevant configuration from theconfigservice and thus seeding it with configured input filter services. This means that theinput_filtersconfiguration will now be honored in non-zend-mvc contexts.
-
2.7.318 Aug 2016Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #115 fixes
retrieval of unknown fields when using a
CollectionInputFilter. Previously, it returned all fields in the collection, not just the unknown fields, which was a different behavior from all other input filters. Now it will return only the unknown fields for each collection. - #108 fixes
the
InputFilterPluginManager::populateFactory()method to restore behavior from prior to the 2.7 series; specifically, previously it would inject itself as the plugin manager to input filter factories when under zend-servicemanager v2; it now will do so again. - #116 fixes the
behavior of
CollectionInputFilter::setData(). Prior to this release, it would validate whether the data represented a collection (i.e., it was an array or traversable) and whether individual items in the collection were data sets (i.e., arrays or traversables) only duringisValid()and/orgetUnknown()calls, raising exceptions during runtime. These should have been considered invalid arguments when the data was provided; they now are. As such,setData()now raisesZend\InputFilter\Exception\InvalidArgumentExceptionfor invalid data, ensuring thatisValid()andgetUnknown()only ever operate on usable collections and collection sets. - #118 fixes aggregation of error messages when validating collections to ensure only the error messages specific to a given datum are presented.
-
2.7.211 Jun 2016Release notes
Open source →Added
- #105 adds and publishes the documentation to https://zendframework.github.io/zend-inputfilter
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #110 fixes an
issue with
InputFilterAbstractServiceFactorywhereby it was not working when the provided container is not a plugin manager, but rather the application container.
-
2.7.118 Apr 2016Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #104 fixes the
Module::init()method to properly receive aModuleManagerinstance, and not expect aModuleEvent.
-
2.7.007 Apr 2016Release notes
Open source →Added
- #3 updates the
InputFilterAbstractServiceFactoryto inject the created input filter factory with theInputFilterManagerservice, ensuring that the generated factory can pull named input filters and inputs from the container as needed. - #100 adds a
number of classes, in order to better allow usage as a standalone component:
InputFilterPluginManagerFactory, ported from zend-mvc, allows creating and returning anInputFilterPluginManager.ConfigProvidermaps theInputFilterManagerservice to the above factory, and enables theInputFilterAbstractServiceFactory.Moduledoes the same asConfigProvider, within a zend-mvc context, and also registers a specification with the zend-modulemanagerServiceListenerto allow modules to configure the input filter plugin manager.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
- #3 updates the
-
2.6.107 Apr 2016Release notes
Open source →Added
- #68 adds support
for using either named keys or a
nameelement in input filter specs parsed by theInputFilterAbstractServiceFactory.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #68 adds support
for using either named keys or a
-
2.6.018 Feb 2016 -
2.5.503 Sep 2015Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#22 adds tests to verify two conditions around inputs with fallback values:
- If the input was not in the data set, it should not be represented in either the list of valid or invalid inputs.
- If the input was in the data set, but empty, it should be represented in the list of valid inputs.
-
#31 updates the
InputFilterInterface::add()docblock to match existing, shipped implementations. -
#25 updates the input filter to prevent validation of missing optional fields (a BC break since 2.3.9). This change likely requires changes to your inputs as follows:
$input = new Input(); $input->setAllowEmpty(true); // Disable BC Break logic related to treat `null` values as valid empty value instead *not set*. $input->setContinueIfEmpty(true); // Disable BC Break logic related to treat `null` values as valid empty value instead *not set*. $input->getValidatorChain()->attach( new Zend\Validator\NotEmpty(), true // break chain on failure );$inputSpecification = [ 'allow_empty' => true, 'continue_if_empty' => true, 'validators' => [ [ 'break_chain_on_failure' => true, 'name' => 'Zend\\Validator\\NotEmpty', ], ], ]; -
Numerous fixes aimed at bringing the functionality back to the pre-2.4 code, and improving quality overall of the component via increased testing and test coverage.
-
2.5.411 Aug 2015 -
2.5.303 Aug 2015Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #10 fixes an
issue with with the combination of
required,allow_empty, and presence of a fallback value on an input introduced in 2.4.5. Prior to the fix, the fallback value was no longer considered when the value was required but no value was provided; it now is.
-
2.5.228 Jul 2015Release notes
Open source →Added
- #2 adds support
in
Zend\InputFilter\Factoryfor using the composedInputFilterManagerto retrieve an input of a giventypebased on configuration; only if the type is not available in the factory will it attempt to directly instantiate it.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #7 fixes an issue
with the combination of
requiredandallow_empty, now properly invalidating a data set if therequiredinput is missing entirely (previously, it would consider the data set valid, and auto-initialize the missing input tonull).
- #2 adds support
in
-
2.5.103 Jun 2015Nothing published for this version
-
2.5.003 Jun 2015Nothing published for this version
-
2.4.1309 Sep 2015Nothing published for this version
-
2.4.12no dateNothing published for this version
-
2.4.11no dateNothing published for this version
-
2.4.10no dateNothing published for this version
-
2.4.9no dateNothing published for this version
-
2.4.8no dateRelease notes
Open source →Added
- Nothing.
Deprecated
-
#26 Deprecate magic logic for auto attach a NonEmpty validator with breakChainOnFailure = true. Instead append NonEmpty validator when desired.
$input = new Zend\InputFilter\Input(); $input->setContinueIfEmpty(true); $input->setAllowEmpty(true); $input->getValidatorChain()->attach(new Zend\Validator\NotEmpty(), /* break chain on failure */ true);
Removed
- Nothing.
Fixed
- Nothing.
-
2.4.711 Aug 2015 -
2.4.603 Aug 2015Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #10 fixes an
issue with with the combination of
required,allow_empty, and presence of a fallback value on an input introduced in 2.4.5. Prior to the fix, the fallback value was no longer considered when the value was required but no value was provided; it now is.
-
2.4.528 Jul 2015Release notes
Open source →Added
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- #7 fixes an issue
with the combination of
requiredandallow_empty, now properly invalidating a data set if therequiredinput is missing entirely (previously, it would consider the data set valid, and auto-initialize the missing input tonull).
-
2.4.407 May 2015Nothing published for this version
-
2.4.3no dateNothing published for this version
-
2.4.2no dateNothing published for this version
-
2.4.1no dateNothing published for this version
-
2.4.023 Mar 2015Nothing published for this version
-
2.3.913 Jan 2015Nothing published for this version
-
2.3.8no dateNothing published for this version
-
2.3.7no dateNothing published for this version
-
2.3.6no dateNothing published for this version
-
2.3.5no dateNothing published for this version
-
2.3.4no dateNothing published for this version
-
2.3.311 Aug 2014Nothing published for this version
-
2.3.2no dateNothing published for this version
-
2.3.115 Apr 2014Nothing published for this version
-
2.3.012 Mar 2014Nothing published for this version
-
2.2.1005 Mar 2014Nothing published for this version
-
2.2.9no dateNothing published for this version
-
2.2.8no dateNothing published for this version
-
2.2.7no dateNothing published for this version
-
2.2.6no dateNothing published for this version
-
2.2.531 Oct 2013Nothing published for this version
-
2.2.423 Aug 2013Nothing published for this version
-
2.2.321 Aug 2013Nothing published for this version
-
2.2.222 Jul 2013Nothing published for this version
-
2.2.112 Jun 2013Nothing published for this version
-
2.2.010 May 2013Nothing published for this version
-
2.1.617 Apr 2013Nothing published for this version
-
2.1.5no dateNothing published for this version