Skip to content

Commit

Permalink
wat
Browse files Browse the repository at this point in the history
  • Loading branch information
derf committed Jul 26, 2024
1 parent 39d5fa9 commit 6ed2cd6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/Travelynx/Controller/Traveling.pm
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,15 @@ sub geolocation {
my $lat = $self->param('lat');
my $backend_id = $self->param('backend') // 0;

if ( not $lon or not $lat or $backend_id !~ m{ ^ \d+ $ }x ) {
$self->render( json => { error => 'Invalid lon/lat received' } );
if ( not $lon or not $lat ) {
$self->render(
json => { error => "Invalid lon/lat (${lon}/${lat}) received" } );
return;
}

if ( $backend_id !~ m{ ^ \d+ $ }x ) {
$self->render(
json => { error => "Invalid backend (${backend_id}) received" } );
return;
}

Expand Down

0 comments on commit 6ed2cd6

Please sign in to comment.