RE: [PEAR-DEV] projecthoneypot

From: Date: Fri, 13 Mar 2009 07:31:15 +0000
Subject: RE: [PEAR-DEV] projecthoneypot
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-51617@lists.php.net to get a copy of this message
>> Tho I must say - the honeypot project isn't all that bad + we are >> only stopping off people that have been listed as a spammer and with >> activity during the last 30 days, maybe that is still too high, dunno. My IP wasn't listed as spam source - suspicious it was, because it's real IP I guess. I paid my ISP for real IP 3 months ago, and can't say what previous owner used it for, but 3 months is more than 30 days, right? >Most of the time they came from people who wanted to submit bug reports >-- loosing bug reports because people were wrongly blocked by black >lists sounds like a major drawback to me. Could someone else post the report? For HTML_quickForm v3.2.10. OS: irrelevant PHP Version: 5.2.6 Description: ------------ The docs says: "To validate a group as a whole, just use HTML_QuickForm::addRule(). The group elements' values will be passed to the validation function as an array." But the rule added for a group via addRule() always fails validation both server and client side. Test script: --------------- <?php require_once("HTML/QuickForm.php"); $form = new HTML_QuickForm('test'); $group[] = $form->createElement('text', 'txt1'); $group[] = $form->createElement('text', 'txt2'); $form->addGroup($group, 'group'); $form->addElement('submit', 'btnSubmit', 'submit'); // for whole group always fails $form->addRule('group', 'numbers only', 'numeric', null, 'client'); // for each separately works fine // $rules['txt1'][] = array('numbers only', 'numeric', null, 'client'); // $rules['txt2'][] = array('numbers only', 'numeric', null, 'client'); // $form->addGroupRule('group', $rules); $form->validate(); echo $form->toHtml(); ?> Expected result: ---------------- Expecting all values of group elements to be passed to validation one by one. Actual result: -------------- All values of group elements passed to validation function as an array on RuleRegistry.php:158. I guess it was planned that array will be cycled in foreach on RuleRegistry.php:151, but execution never goes there. And finally validation for example above fails on Regex.php:69, cause preg_match gets array instead of single string and throws an error. That's server side, client side js fails too. - Boris

« previous php.pear.dev (#51617) next »