Posted by deko on 02/11/07 01:50
> 1. Increase the error_reporting level and you will find some sloppy notices
> 2. Have a look at parse_url(), which might be useful
> 3. Use preg_* functions instead of POSIX ereg* function (performance)
> 4. Strings like the following cause infinite loops:
>
> getURL('fofo http://discovery.co.uk/../foo');
>
> Probable fix:
>
> = Replace:
>
> if (!eregi("^(com|net|org...)$", $urlString_a[$i])) {
> ...
> }
>
> = With:
>
> if (preg_match("!^(com|net|org...)[^$]!", $urlString_a[$i], $m)) {
> $urlString_a[$i] = $m[1];
> }
Outstanding. Thanks for the constructive feedback.
[Back to original message]
|