Re: [PATCH] Validate::url

From: Date: Fri, 05 Dec 2003 11:11:52 +0000
Subject: Re: [PATCH] Validate::url
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24184@lists.php.net to get a copy of this message
Martin Jansen wrote:
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.
Implemented function_exists. I blame sleep deprivation on missing that :) Also FALSE, NULL, TRUE all lowercased :) See http://pear.php.net/bugs/bug.php?id=357 if you're interested. - Davey

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