Loading lib/Travelynx/Controller/Api.pm +10 −4 Original line number Diff line number Diff line Loading @@ -18,8 +18,11 @@ sub sanitize { if ( $type eq '' ) { return '' . $value; } if ( $value =~ m{ ^ [0-9.e]+ $ }x ) { return 0 + $value; } return 0; } sub documentation { my ($self) = @_; Loading Loading @@ -457,9 +460,12 @@ sub import_v1 { lax => $payload->{lax} ? 1 : 0, ); if ( $payload->{route} and ref( $payload->{route} ) eq 'ARRAY' ) { $opt{route} = [ map { sanitize( q{}, $_ ) } @{ $payload->{route} } ]; if ( $payload->{intermediateStops} and ref( $payload->{intermediateStops} ) eq 'ARRAY' ) { $opt{intermediateStops} = [ map { sanitize( q{}, $_ ) } @{ $payload->{intermediateStops} } ]; } for my $key (qw(sched_departure rt_departure sched_arrival rt_arrival)) Loading templates/api_documentation.html.ep +1 −3 Original line number Diff line number Diff line Loading @@ -189,10 +189,8 @@ "scheduledTime": 1556083980, (UNIX-Timestamp)<br/> "realTime": 1556083980, (UNIX-Timestamp, optional, default == scheduledTime)<br/> },<br/> "route" : [ (optionale Liste mit Unterwegshalten als Name oder DS100, darf keine Stationen vor Checkin oder nach Checkout beinhalten)<br/> "Essen Hbf",<br/> "intermediateStops" : [ (optionale Liste mit Unterwegshalten als Name oder DS100, darf keine Stationen vor Checkin oder nach Checkout beinhalten)<br/> "Essen Süd",<br/> "Essen Stadtwald"<br/> ],<br/> "comment" : "Beliebiger Text" (optionaler Freitext-Kommentar)<br/> } Loading Loading
lib/Travelynx/Controller/Api.pm +10 −4 Original line number Diff line number Diff line Loading @@ -18,8 +18,11 @@ sub sanitize { if ( $type eq '' ) { return '' . $value; } if ( $value =~ m{ ^ [0-9.e]+ $ }x ) { return 0 + $value; } return 0; } sub documentation { my ($self) = @_; Loading Loading @@ -457,9 +460,12 @@ sub import_v1 { lax => $payload->{lax} ? 1 : 0, ); if ( $payload->{route} and ref( $payload->{route} ) eq 'ARRAY' ) { $opt{route} = [ map { sanitize( q{}, $_ ) } @{ $payload->{route} } ]; if ( $payload->{intermediateStops} and ref( $payload->{intermediateStops} ) eq 'ARRAY' ) { $opt{intermediateStops} = [ map { sanitize( q{}, $_ ) } @{ $payload->{intermediateStops} } ]; } for my $key (qw(sched_departure rt_departure sched_arrival rt_arrival)) Loading
templates/api_documentation.html.ep +1 −3 Original line number Diff line number Diff line Loading @@ -189,10 +189,8 @@ "scheduledTime": 1556083980, (UNIX-Timestamp)<br/> "realTime": 1556083980, (UNIX-Timestamp, optional, default == scheduledTime)<br/> },<br/> "route" : [ (optionale Liste mit Unterwegshalten als Name oder DS100, darf keine Stationen vor Checkin oder nach Checkout beinhalten)<br/> "Essen Hbf",<br/> "intermediateStops" : [ (optionale Liste mit Unterwegshalten als Name oder DS100, darf keine Stationen vor Checkin oder nach Checkout beinhalten)<br/> "Essen Süd",<br/> "Essen Stadtwald"<br/> ],<br/> "comment" : "Beliebiger Text" (optionaler Freitext-Kommentar)<br/> } Loading