Re: QF 3.2 - regex throwing errors

From: Date: Wed, 05 Nov 2003 18:11:24 +0000
Subject: Re: QF 3.2 - regex throwing errors
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8782@lists.php.net to get a copy of this message
Hi! Mike Carter wrote:
Just upgraded to QF 3.2 and appear to be getting a regular expression error now. I defined a rule to check if a postcode entered was valid: $this->addRule('postcodeGroup', $this->language['L_InvalidPostcode'], 'regex', '/[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}/', 'client'); When the form is submitted the validation appears to be executed on the server side now (why?) and also kicks up the warning:
Server-side validation is *always* on.
Warning: preg_match() expects parameter 2 to be string, array given in /usr/local/lib/php/HTML/QuickForm/Rule/Regex.php on line 61 Did something major change? I cannot see anything relevant mentioned in the changes for this version.
Oh, so we do have a BC break after all... Consider using addGroupRule() instead of addRule() if setting such a rule on a group.

« previous php.pear.general (#8782) next »