Re: Package proposal: Net_Ip
| From: | Stefan Walk | Date: | Fri, 30 May 2003 15:11:31 +0000 |
| Subject: | Re: Package proposal: Net_Ip | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16839@lists.php.net to get a copy of this message | ||
On Fri, May 30, 2003 at 10:54:33AM -0400, Hans Lellelid wrote:
>
> Hi Stefan,
>
> ... If this is what you meant, then you should have read this code a little
> more closely before claiming that the last return is never executed.
Oh, you're right. Sorry. That one was only a minor point anyway, wrote
that out of memory.
> Anyway -- I don't know whether this class duplicates existing IP stuff, but
> I do think it's well written and I like the fact that it checks for proxy
> servers (i.e. I can certainly use it).
Well, other than validating IP addresses (which
long2ip(ip2long($ip)) == $ip) does just as good), wrapping gethostbyname,
wrapping gethostbyaddr, fetching the first ip out of a list it does
almost nothing that isn't HTTP specific. And for the proxy stuff, in case
you don't know it already - you can't trust these headers. Even if they
are present, they may be faked, and if they are absent, a proxy may still
be in between. So i strongly suggest you only use it for statistics or
alike.
--
Regards,
Stefan Walk
<swalk@prp0.prp.physik.tu-darmstadt.de>