Odd...I thought there was client side checking (pouring through dozens of
versions of code...).  Ah well - I'll see if we can't get something
inserted locally.  Here's a reg_exp you can use for IP addresses (this
will only be used for the customer created IP addresses).

Be warned - we check server side, so if we need to change the reg_exp for
any reason we can do it easily and seamlessly.  And this is from an older
version of the code, and may require some massaging:

sub ip_syntax {

    my $that = shift;
    my $ip = shift;

    if (length $ip > 15) {
        return undef;
    } elsif ($ip !~ /^\d+\.\d+\.\d+\.\d+$/) {
        return undef;
    }

    my @parts = split /\./, $ip;
    foreach (@parts) {
        if ($_ >= 255) {
            return undef;
        }
    }
    return 1;

}

Charles Daminato
TUCOWS Product Manager
[EMAIL PROTECTED]

On Wed, 13 Jun 2001, Estibaliz Alvarez wrote:

>
> Hope this is the right place to post this. If not, sorry!!
>
> I want to allow my clients to insert their own nameservers in the form,
> but the code has no restriction regarding the entry in those fields. I
> mean, you can enter whatever you want, numbers, any characters,
> punctuation marks, etc, and nothing complains. Does anybody have a patch
> which validates IP addresses? I guess it should be implemented in the
> "validate" procedure in XML_Client.pm
>
> Thanks
>
>       Esti
>
>

Reply via email to