diff options
author | Dave Arter <davea@mysociety.org> | 2017-12-19 12:40:06 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-12-19 13:05:16 +0000 |
commit | 152c6b62e4cfc6e2e02da0d7bca7603909366d69 (patch) | |
tree | b720d3751a44b41f3ddad5b7eb6827ce0d26d6dd | |
parent | 7e15bd3db202363db4bab8fa7c9f462eabe28fce (diff) |
[Oxfordshire] Allow lat/lon to be sent as integers to Exor Open311 CGI
It took a few years but somebody finally made a report at a whole-number
lat/lon (52°N in this case) which was duly rejected by the OCC Exor
script as not being a valid coordinate due to the assumption that all
lat/lon values will contain a ‘.’ character.
This commit makes the decimal part of the value optional, allowing
integer values to be sent.
-rwxr-xr-x | bin/oxfordshire/open311_service_request.cgi | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/oxfordshire/open311_service_request.cgi b/bin/oxfordshire/open311_service_request.cgi index 4496ff213..95d3d34ef 100755 --- a/bin/oxfordshire/open311_service_request.cgi +++ b/bin/oxfordshire/open311_service_request.cgi @@ -114,7 +114,7 @@ XML # returns true if this looks like a long/lat value #------------------------------------------------------------------ sub is_longlat { - return $_[0] =~ /^-?\d+\.\d+$/o? 1 : 0; + return $_[0] =~ /^-?\d+(\.\d+)?$/o ? 1 : 0; } #------------------------------------------------------------------ |