This commit is contained in:
Birte Kristina Friesel 2024-07-26 21:14:58 +02:00
parent 39d5fa91e4
commit 6ed2cd6f47
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -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;
}