All notable changes to this project will be documented in this file, in reverse chronological order by release.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#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.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #174 adds support for PHP 7.3.
- Nothing.
- Nothing.
- Nothing.
- #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\Upload
as the service, instead of the previous 'fileuploadfile`; this release returns to the original behavior.
-
#172 adds support for PSR-7
UploadedFileInterface
toZend\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. TheFileInput
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 aNotEmpty
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 methodsetNotEmptyValidator()
. -
if using a factory, provide the key
required_message
as a sibling torequired
, containing the custom message. This will replace the typicalIS_EMPTY
message.
-
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #167 fixes the combination of marking an
ArrayInput
required, and passing an empty array for validation; it now correctly detects these as invalid.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#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
ConfigProvider
as per the latest documentation. In particular, it ensures that theInputFilterAbstractFactory
is registered under theinput_filters
configuration instead of thedependencies
configuration.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#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 tosetData()
would raise an exception, instead of being treated as an empty data set.
-
#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.
- Nothing.
- Nothing.
- #142 removes support for HHVM.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #156 fixes an
issue introduced in 2.7.5 whereby the filter and validator chains composed in
inputs pulled from the
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.
- Nothing.
- Nothing.
- Nothing.
-
#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.
- Nothing.
- #122 maps the
Zend\InputFilter\InputFilterPluginManager
service toZend\InputFilter\InputFilterPluginManagerFactory
, and adds an alias fromInputFitlerPluginManager
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.
- Nothing.
- Nothing.
- #137 fixes how the
InputFilterPluginManagerFactory
factory initializes the plugin manager instance, ensuring it is injecting the relevant configuration from theconfig
service and thus seeding it with configured input filter services. This means that theinput_filters
configuration will now be honored in non-zend-mvc contexts.
- Nothing.
- Nothing.
- Nothing.
- #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\InvalidArgumentException
for 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.
- #105 adds and publishes the documentation to https://zendframework.github.io/zend-inputfilter
- Nothing.
- Nothing.
- #110 fixes an
issue with
InputFilterAbstractServiceFactory
whereby it was not working when the provided container is not a plugin manager, but rather the application container.
- Nothing.
- Nothing.
- Nothing.
- #104 fixes the
Module::init()
method to properly receive aModuleManager
instance, and not expect aModuleEvent
.
- #3 updates the
InputFilterAbstractServiceFactory
to inject the created input filter factory with theInputFilterManager
service, 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
.ConfigProvider
maps theInputFilterManager
service to the above factory, and enables theInputFilterAbstractServiceFactory
.Module
does the same asConfigProvider
, within a zend-mvc context, and also registers a specification with the zend-modulemanagerServiceListener
to allow modules to configure the input filter plugin manager.
- Nothing.
- Nothing.
- Nothing.
- #68 adds support
for using either named keys or a
name
element in input filter specs parsed by theInputFilterAbstractServiceFactory
.
- Nothing.
- Nothing.
- #67 and
#73 fix
localization of the
NotEmpty
validation error message (created for any required input for which a value was not provided).
- Nothing.
- Nothing.
- Nothing.
- #86, #95, and #96 update the component to be forwards-compatible with zend-servicemanager v3.
- #72
ArrayInput
value is properly reset afterBaseInputFilter::setData()
- Nothing.
- Nothing.
- Nothing.
-
#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.
- Nothing.
- Nothing.
- Nothing.
- #15 ensures that
ArrayAccess
data provided to an input filter usingsetData()
can be validated, a scenario that broke with #7.
- Nothing.
- Nothing.
- Nothing.
- #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 adds support
in
Zend\InputFilter\Factory
for using the composedInputFilterManager
to retrieve an input of a giventype
based on configuration; only if the type is not available in the factory will it attempt to directly instantiate it.
- Nothing.
- Nothing.
- #7 fixes an issue
with the combination of
required
andallow_empty
, now properly invalidating a data set if therequired
input is missing entirely (previously, it would consider the data set valid, and auto-initialize the missing input tonull
).
- Nothing.
-
#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);
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #15 ensures that
ArrayAccess
data provided to an input filter usingsetData()
can be validated, a scenario that broke with #7.
- Nothing.
- Nothing.
- Nothing.
- #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.
- Nothing.
- Nothing.
- Nothing.
- #7 fixes an issue
with the combination of
required
andallow_empty
, now properly invalidating a data set if therequired
input is missing entirely (previously, it would consider the data set valid, and auto-initialize the missing input tonull
).