Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8.0
-
Component/s: Zend_Filter_Input
-
Labels:None
-
Fix Version Priority:Should Have
Description
I have a date filter called My_Filter_Date and I need to use this before the standard Zend_Validate_Date validation, in ZF 1.5.1 this happens
$filters = array(
'dob' => array('Date')
);
$validators = array(
'dob' => array('Date')
);
$data = array(
'dob' => '1990-01-01'
),
$options = array(
'inputNamespace' => array('My_Filter', 'My_Validate'),
);
$filter = new Zend_Filter_Input($filters, $validators, $data, $options);
$filter->process(); //throws "Zend_Filter_Exception: Class based on basename 'Date' must implement the 'Zend_Validate_Interface' interface" from line 914 Zend/Filter/Input.php
line 908 of Zend/Filter/Input.php pulls out the wrong Class name from the method getPluginLoader since adding inputNamespace doesn't specify which type, either filter or validator or maybe both, the specified directory holds.
maybe it would be useful to add a key to the inputNamespace options array like so:
$options = array(
'inputNamespace' => array(
'filter' => 'My_Filter',
'validate' => 'My_Validate'
),
);
This also breaks when I have a filter and a validator for the same thing... i.e. My_Filter_SSN and My_Validate_SSN
exception thrown as "Zend_Filter_Exception: Class based on basename 'SSN' must implement the 'Zend_Filter_Interface' interface"