summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-07-26 21:14:58 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-07-26 21:14:58 +0200
commit6ed2cd6f477e36422a15d9050dc1d4126b7e3a7d (patch)
treeef76446888321124464ed652a928d586be525801 /lib
parent39d5fa91e4dffcfb8fb13af86456862b875b4f98 (diff)
wat
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm11
1 files changed, 9 insertions, 2 deletions
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;
}