From 6ed2cd6f477e36422a15d9050dc1d4126b7e3a7d Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 26 Jul 2024 21:14:58 +0200 Subject: wat --- lib/Travelynx/Controller/Traveling.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/Travelynx/Controller') diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 6b421d1..cbe3e4a 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -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; } -- cgit v1.2.3