Unverified Commit 057c7c2b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Carriage: Only parse UIC ID if it has the correct length

parent ab8e27c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ sub new {
	$ref->{section}       = $json{platformPosition}{sector};
	$ref->{type}          = $json{type}{constructionType};

	if ( defined $ref->{uic_id} ) {
	if ( defined $ref->{uic_id} and length( $ref->{uic_id} ) >= 12 ) {
		$ref->{uic_id} =~ s{ ^ \d{11} \K - }{}x;
		$ref->{country} = substr( $ref->{uic_id}, 2, 2 );
	}