Inputfilter notice

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Inputfilter notice

Daniel Khan-2
Hello List,

I am using the current preview release and just started to use the
Inputfilter. I think I may have found a little problem:
Here's the code.

<?php
error_reporting(E_ALL);
function setRequiredAction() {
  $filterPost = new Zend_InputFilter($_POST);
  $date = $filterPost->getInt('NotExistingPostVariable');
}
?>

Produces:
Notice: Undefined index: NotExistingPostVariable in
/usr/lib/php/ZendFramework-0.1.3/library/Zend/InputFilter.php on line 104

I think InputFilter should test with isset() or empty() if the post
array contains the variable.

Maybe this is allready fixed in current development versions.

regards

--
Daniel Khan
Reply | Threaded
Open this post in threaded view
|

Re: Inputfilter notice

Michael Patrick-3
Daniel Khan wrote:
> Produces:
> Notice: Undefined index: NotExistingPostVariable in
> /usr/lib/php/ZendFramework-0.1.3/library/Zend/InputFilter.php on line 104
>
> I think InputFilter should test with isset() or empty() if the post
> array contains the variable.
>
> Maybe this is allready fixed in current development versions.

Known bug.