telize

High performance JSON IP and GeoIP REST API (IP Geolocation)
Log | Files | Refs | README | LICENSE

commit 6532859ccf0f6319852026f354a235ee0d93be40
parent 276faffd07a7e0378f331780766e9263c914cdfa
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Mon, 26 Oct 2015 15:26:02 +0100

Convert latitude and longitude to numeric values after validating arguments

Diffstat:
Mtelize | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/telize b/telize @@ -116,11 +116,15 @@ server { for item, value in pairs(args) do if args[item] == "" then args[item] = nil - elseif item == "latitude" or item == "longitude" then - args[item] = tonumber(value) end end + -- Convert latitude and longitude to numeric values + if args.latitude ~= nil and args.longitude ~= nil then + args.latitude = tonumber(args.latitude) + args.longitude = tonumber(args.longitude) + end + -- Convert city name to UTF-8 if it exists if args.city ~= nil then args.city = cd:iconv(args.city)