Details
-
Type:
Patch
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.11.4
-
Fix Version/s: 1.11.11, Next Major Release
-
Component/s: Zend_Filter_Input, Zend_Validate
-
Labels:
Description
Given the following code
require_once 'Zend/Filter/Input.php';
require_once 'Zend/Validate/NotEmpty.php';
$notEmpty = new Zend_Validate_NotEmpty();
$notEmpty->setMessage("\"key\" may not be empty", Zend_Validate_NotEmpty::IS_EMPTY);
$filter = New Zend_Filter_Input(array(), array(
'key' => array($notEmpty)
), array('key' => ""));
var_dump($filter->getInvalid());
I expect the following result:
array
'key' =>
array
'isEmpty' => string 'You must give a non-empty value for field 'key''
However, I'm getting the following result
array
'key' =>
array
'isEmpty' => string '"key" may not be empty'
which means that there is no way to actually use the NotEmpty Validator along with a custom error message, since some funny Zend_Filter_Input implementation preceeds my validator configuration.
uhm... what's wrong with the monospace wiki syntax?