From: ivan Date: Sun, 11 Oct 2009 01:39:17 +0000 (+0000) Subject: ::1 becomes 127.0.0.1 in IP checks X-Git-Tag: root_of_svc_elec_features~792 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=0e3d27730f91e10abb8f655d578eb0fd51b82cd1 ::1 becomes 127.0.0.1 in IP checks --- diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index f17b24036..d4d7ca137 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -2204,12 +2204,14 @@ sub ut_hexn { } =item ut_ip COLUMN -Check/untaint ip addresses. IPv4 only for now. +Check/untaint ip addresses. IPv4 only for now, though ::1 is auto-translated +to 127.0.0.1. =cut sub ut_ip { my( $self, $field ) = @_; + $self->setfield($field, '127.0.0.1') if $self->getfield($field) eq '::1'; $self->getfield($field) =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ or return "Illegal (IP address) $field: ". $self->getfield($field); for ( $1, $2, $3, $4 ) { return "Illegal (IP address) $field" if $_ > 255; } @@ -2219,7 +2221,8 @@ sub ut_ip { =item ut_ipn COLUMN -Check/untaint ip addresses. IPv4 only for now. May be null. +Check/untaint ip addresses. IPv4 only for now, though ::1 is auto-translated +to 127.0.0.1. May be null. =cut