Re: cvs: pear /Validate Validate.php

From: Date: Wed, 29 May 2002 08:10:06 +0000
Subject: Re: cvs: pear /Validate Validate.php
References: 1  Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4233@lists.php.net to get a copy of this message
le 29/05/02 9:41, Tomas V.V.Cox à cox@idecnet.com a écrit : > cox Wed May 29 03:41:58 2002 EDT > > Modified files: > /pear/Validate Validate.php > Log: > - Enhance number() with decimal precition and range > - Added url validation > + } > + > + function url($url, $domain_check = false) > + { > + $purl = parse_url($url); > + if (eregi('^http$', @$purl['scheme']) && > !empty($purl['host']) { I guess an url can be anything like ftp://, https://, file://, and so on. Maybe this method should be called http() ? IMHO, there should be a common validate method which will accept a regular expression and a value as parameters. You might be interested in what we have done in the validate method of HTML_QuickForm. Also look at the regular expression patterns declared at the top of the class. Bertrand Mansion Mamasam

« previous php.pear.cvs (#4233) next »