X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FIP_Mixin.pm;h=fc3a0146b04ac83924372b56da10561676864950;hp=b68b0b6241a6cbfe527058b30a32da0a6537dfa3;hb=6de42f2b2f6c58cf6ce0db933c2d8d5d40b411ca;hpb=a8a95509bfca2510f1e5627e5a0d269ed78834cb diff --git a/FS/FS/IP_Mixin.pm b/FS/FS/IP_Mixin.pm index b68b0b624..fc3a0146b 100644 --- a/FS/FS/IP_Mixin.pm +++ b/FS/FS/IP_Mixin.pm @@ -94,6 +94,15 @@ sub ip_check { $self->ip_addr(''); } + # strip user-entered leading 0's from IPv4 addresses + # Parsers like NetAddr::IP interpret them as octal instead of decimal + $self->ip_addr( + join( '.', ( + map{ int($_) } + split( /\./, $self->ip_addr ) + )) + ) if $self->ip_addr =~ /\./ && $self->ip_addr =~ /[\.^]0/; + if ( $self->ip_addr and !$self->router and $self->conf->exists('auto_router') ) {