NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #5525 most downloaded on Packagist
Normalize and validate input sets from the web, APIs, the CLI, and more, including files
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 the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
81 releases · first in 2012
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #185 fixes validation response on invalid file upload request. #181 fixes m
#185 fixes validation response on invalid file upload request.
#181 fixes missing abstract service factory registration in Module as per the latest documentation. In particular, it ensures that the InputFilterAbstractFactory is registered under the input_filters configuration.
#180 fixes attaching validators on creation of InputFilter - priority value is now used.
One column per quarter.
public function getUnfilteredData() : array | object ; public function setUnfilteredData( array | object $ data ) : $ this ;
#176 adds the interface UnfilteredDataInterface, with the following methods:
public function getUnfilteredData() : array|object;
public function setUnfilteredData(array|object $data) : $this;By default, the BaseInputFilter now 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.
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 over
FileInput. 2.9.0 changed the default to use theZend\Validator\File\Upload as the service,provide a custom NotEmpty validator via the new method setNotEmptyValidator() .
#172 adds support for PSR-7 UploadedFileInterface to Zend\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. The FileInput class 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 a NotEmpty validator, 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 NotEmpty validator via the new method
setNotEmptyValidator().
if using a factory, provide the key required_message as a sibling to
required, containing the custom message. This will replace the typical
IS_EMPTY message.
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #167 fixes the combination of marking an ArrayInput required, and passing a
ArrayInput required, and passing anAdded Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #163 adds code to BaseInputFilter::populate() to detect non-iterable, non-n
#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 the InputFilterAbstractFactory
is registered under the input_filters configuration instead of the
dependencies configuration.
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #160 adds zend-servicemanager as a direct requirement, rather than a sugges
#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 null value to setData() would raise an exception, instead of being treated as an empty data set.
Added #135 adds Zend\InputFilter\OptionalInputFilter , which allows defining optional sets of data. This acts like a standard input filter, but is con
#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, null data, 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.
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #156 fixes an issue introduced in 2.7.5 whereby the filter and validator ch
InputFilterPluginManager were 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.Added Nothing. Deprecated Nothing. Removed Nothing. Fixed #151 fixes an issue in Factory::createInput() introduced in #2 whereby an input pulled from
#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/or init(). 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.
### Added - Nothing. ### Changes - #122 maps the Zend\InputFilter\InputFilterPluginManager service to Zend\InputFilter\InputFilterPluginManagerFactory
Zend\InputFilter\InputFilterPluginManager service to
Zend\InputFilter\InputFilterPluginManagerFactory, and adds an alias from
InputFitlerPluginManager to 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.InputFilterPluginManagerFactory factory initializes the plugin manager
instance, ensuring it is injecting the relevant configuration from the
config service and thus seeding it with configured input filter services.
This means that the input_filters configuration will now be honored in
non-zend-mvc contexts.### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #115 fixes retrieval of unknown fields when using a CollectionInputF
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.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.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 during isValid() and/or
getUnknown() calls, raising exceptions during runtime. These should have
been considered invalid arguments when the data was provided; they now are. As
such, setData() now raises Zend\InputFilter\Exception\InvalidArgumentException
for invalid data, ensuring that isValid() and getUnknown() only ever
operate on usable collections and collection sets.### Added - #105 adds and publishes the documentation to https://zendframework.github.io/zend-inputfilter ### Deprecated - Nothing. ### Removed - Noth
InputFilterAbstractServiceFactory whereby it was not working when
the provided container is not a plugin manager, but rather the application
container.### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #104 fixes the Module::init() method to properly receive a ModuleMan
Module::init() method to properly receive a ModuleManager instance, and
not expect a ModuleEvent.InputFilterPluginManagerFactory, ported from zend-mvc, allows creating and returning an InputFilterPluginManager.
InputFilterAbstractServiceFactory to inject the created input filter factory
with the InputFilterManager service, ensuring that the generated factory can
pull named input filters and inputs from the container as needed.InputFilterPluginManagerFactory, ported from zend-mvc, allows creating and
returning an InputFilterPluginManager.ConfigProvider maps the InputFilterManager service to the above factory,
and enables the InputFilterAbstractServiceFactory.Module does the same as ConfigProvider, within a zend-mvc context, and
also registers a specification with the zend-modulemanager ServiceListener
to allow modules to configure the input filter plugin manager.### Added - #68 adds support for using *either* named keys *or* a name element in input filter specs parsed by the InputFilterAbstractServiceFactory.
name element in input filter specs
parsed by the InputFilterAbstractServiceFactory.### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #86, #95, and #96 update the component to be forwards-compatible wit
If the input was not in the data set, it should not be represented in either the list of valid *or* invalid inputs.
#22 adds tests to verify two conditions around inputs with fallback values:
#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.
### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #15 ensures that ArrayAccess data provided to an input filter using
### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #10 fixes an issue with with the combination of required, allow_empt
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.### Added - #2 adds support in Zend\InputFilter\Factory for using the composed InputFilterManager to retrieve an input of a given type based on config
Zend\InputFilter\Factory for using the composed InputFilterManager to
retrieve an input of a given type based on configuration; only if the type
is not available in the factory will it attempt to directly instantiate it.required and allow_empty, now properly
invalidating a data set if the required input is missing entirely
(previously, it would consider the data set valid, and auto-initialize the
missing input to null).Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
`php $input = new Zend\InputFilter\Input(); $input->setContinueIfEmpty(true); $input->setAllowEmpty(true); $input->getValidatorChain()->attach(new Zen
#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);
### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #15 ensures that ArrayAccess data provided to an input filter using
### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #10 fixes an issue with with the combination of required, allow_empt
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.### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #7 fixes an issue with the combination of required and allow_empty,
required and allow_empty, now properly
invalidating a data set if the required input is missing entirely
(previously, it would consider the data set valid, and auto-initialize the
missing input to null).Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →