Re: Package proposal: Net_Ip
| From: | Stefan Walk | Date: | Fri, 30 May 2003 12:58:05 +0000 |
| Subject: | Re: Package proposal: Net_Ip | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16830@lists.php.net to get a copy of this message | ||
On Fri, May 30, 2003 at 02:15:23PM +0200, cagrET wrote:
> Maybe before asking this question, you could look at the code and example ?
> is it so hard ?
Answering the question would have taken you just as much time.
The code has quite a few drawbacks by the way.
Client-ip and http-x-forwarded-for headers can be set by anyone,
and your script would assume that they are the `real ip',
making evil people able to circumvent any protections based on IPs.
You use return statements that will never get executed.
You use ereg_* instead of preg_*.
Your factory is in reality a singeton, and if you used constants instead
of properties, it wouldn't be neccessary because you could call the
methods statically.
--
Regards,
Stefan Walk
<swalk@prp0.prp.physik.tu-darmstadt.de>