[solved] Zend_Filter_Input::__construct() had an error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

[solved] Zend_Filter_Input::__construct() had an error

Post by DaveTheAve »

The error:
Catchable fatal error: Argument 1 passed to Zend_Filter_Input::__construct() must be an array, null given, called in W:\www\neoelite\index.php on line 25 and defined in W:\www\neoelite\Lib\Zend\Zend\Filter\Input.php on line 54
My bootstrap:

Code: Select all

Zend::register('FilterGet',      new Zend_Filter_Input($_GET,false));
Zend::register('FilterPost',     new Zend_Filter_Input($_POST,false));
Zend::register('FilterSession',  new Zend_Filter_Input($_SESSION,false));
This error wasn't happening in Zend Framework 0.7 but 0.8 started giving me this error.
Last edited by DaveTheAve on Tue Feb 27, 2007 6:41 pm, edited 1 time in total.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Is $_GET/$_POST/$_SESSION null?
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

Post by DaveTheAve »

Yes, they are null but the problem is I still need this in the registry regardless. Like I said this wasn't a problem in Zend Framework 0.7.

Should I evade the problem by checking if they're null and if so set it to: "$var = array();"?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

That's what I'd recommend. Why are they null though?
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

Post by DaveTheAve »

Don't know why exactly but it works now; thanks.
Post Reply