Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

SmartyValidate: php-warnings when sending empty form

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
arne_anka
Smarty Rookie


Joined: 26 Jun 2006
Posts: 6

PostPosted: Fri Jul 14, 2006 10:03 am    Post subject: SmartyValidate: php-warnings when sending empty form Reply with quote

hi,
i just stumpled upon SmartyValidate and tried the given example (http://www.phpinsider.com/php/code/SmartyValidate/).
if i send the empty form i get
Quote:

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 143

Warning: Cannot use a scalar value as an array in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 241

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 143

Warning: Cannot use a scalar value as an array in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 241

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 143

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 143

Warning: Cannot use a scalar value as an array in /usr/share/php/smarty/libs/SmartyValidate.class.php on line 241


i think the logic fails to handle empty arrays/fields.
is this a failure of the example or a bug of SmartyValidate?
Back to top
View user's profile Send private message
arne_anka
Smarty Rookie


Joined: 26 Jun 2006
Posts: 6

PostPosted: Fri Jul 14, 2006 12:09 pm    Post subject: Reply with quote

well, only those with empty=true, i e
Code:

SmartyValidate::register_validator($id, $field, $criteria, $empty = true)

trigger warnings, so it is rather a bug.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP