Commit 8ed92aed authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Canonicalize all OCFVs on load, not just IP address ranges

This ensures that IPs are padded to three digits per octet, and that
dates are formatted in standard ISO time.
parent 40478732
......@@ -142,16 +142,8 @@ sub LoadByCols {
$cf->Load( $args{CustomField} );
return (0, $self->loc("Cannot load custom field [_1]",$args{CustomField})) unless $cf->id;
if ( $cf->Type && $cf->Type eq 'IPAddressRange' ) {
my ( $sIP, $eIP ) = $cf->ParseIPRange( $args{'Content'} );
if ( $sIP && $eIP ) {
$self->SUPER::LoadByCols( %args,
Content => $sIP,
LargeContent => $eIP
);
}
}
my ($ok, $msg) = $cf->_CanonicalizeValue(\%args);
return ($ok, $msg) unless $ok;
}
return $self->SUPER::LoadByCols(%args);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment