Re: [PATCH] Validate::url
| From: | Martin Jansen | Date: | Fri, 05 Dec 2003 08:54:01 +0000 |
| Subject: | Re: [PATCH] Validate::url | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24174@lists.php.net to get a copy of this message | ||
On Fri Dec 05, 2003 at 03:5423AM +0000, Davey wrote:
> 1. Checks the given URI is valid within the RFC2396 spec.
> 2. If specific allowed protocols are defined in the new 3rd arg,
> it checks its one of those allowed
> 3. If the second arg is TRUE, and the host OS is *nix, it will check
> the DNS, on windows, this doesn't happen as checkdnsrr() is *nix only.
> This can create different results on windows and *nix. If the first two
> checks are valid and the domain does NOT exist, on windows it will
> return TRUE because it cannot check, *nix will return FALSE.
Why don't you just use
if (function_exists(checkdnsrr)) {
...
}
to check if checkdnsrr() is implemented? If that does not work, you still
don't need to use OS_Guess: PEAR.php defines OS_WINDOWS resp. OS_UNIX
for such cases. Apart from that you mustn't use NULL, TRUE or FALSE, but
null, true and false.
The rest of the patch seems to be fine.
--
- Martin Martin Jansen
http://martinjansen.com/