From fba3459752d171d00a2c17d504f2b399fdfc0af9 Mon Sep 17 00:00:00 2001 From: Darryl Quinn Date: Thu, 10 Dec 2015 12:12:15 -0600 Subject: [PATCH] bugfix: fix validation to not allow - at the end of the line --- files/www/cgi-bin/admin | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/files/www/cgi-bin/admin b/files/www/cgi-bin/admin index 86df6892..dcf8c4d9 100755 --- a/files/www/cgi-bin/admin +++ b/files/www/cgi-bin/admin @@ -448,7 +448,7 @@ if($parms{button_location}) if($parms{gridsquare}) { # validate values - if($parms{gridsquare} =~ /[A-Z][A-Z]\d\d[a-z][a-z]/) + if($parms{gridsquare} =~ /^[A-Z][A-Z]\d\d[a-z][a-z]$/) { # delete/define file unlink("/etc/gridsquare") if(-f "/etc/gridsquare"); @@ -468,7 +468,7 @@ if($parms{button_location}) if($parms{latitude} and $parms{longitude}) { # validate values - if($parms{latitude} =~ /^([-+]?\d{1,2}([.]\d+)?)/ and $parms{longitude} =~ /^([-+]?\d{1,3}([.]\d+)?)/) { + if($parms{latitude} =~ /^([-+]?\d{1,2}([.]\d+)?)$/ and $parms{longitude} =~ /^([-+]?\d{1,3}([.]\d+)?)$/) { # delete/define file unlink("/etc/latlon") if(-f "/etc/latlon"); $rcgood=open(my $ll, ">", "/etc/latlon"); @@ -749,13 +749,13 @@ print "
\n"; # LOCATION DATA print "\n"; print "\n"; -print ""; -print ""; -print ""; +print ""; +print ""; +print ""; print "\n"; print "\n"; -print "\n"; -print "\n"; +print "\n"; +print "\n"; print "\n"; print "\n"; print "
Location Data
LatitudeLongitudeGrid SquareLatitudeLongitudeGrid Square
";