]> marstr Code Repo - orthographic-api/commitdiff
Corrected an issue which would write actual latitude/longitude into the file name... master
authorMarStr <marcus@marstr.online>
Tue, 27 Aug 2024 10:59:24 +0000 (12:59 +0200)
committerMarStr <marcus@marstr.online>
Tue, 27 Aug 2024 10:59:24 +0000 (12:59 +0200)
index.php

index 9b6768ee998788e4e2ff9736f64a5d7df11fd262..6859b26dc6fbaf8a3147345e9d0ee8a8f8e62d41 100644 (file)
--- a/index.php
+++ b/index.php
@@ -11,7 +11,7 @@ if (isset($_POST))
 {
        // Convert the JSON in POST to an array
        $json = json_decode(file_get_contents('php://input'), true);
-       $filename = $root_folder . $json["tile_lat"] . "-" . $json["square_lat"] . "_" . $json["tile_lng"] . "-" . $json["square_lng"] . ".xml";
+       $filename = $root_folder . intval($json["tile_lat"]) . "-" . $json["square_lat"] . "_" . intval($json["tile_lng"]) . "-" . $json["square_lng"] . ".xml";
        $url = "http://www.overpass-api.de/api/xapi?*[bbox=".$json["bbox"]["lng"].",".$json["bbox"]["lat"].",".$json["bbox"]["lng_b"].",".$json["bbox"]["lat_b"]."]";
 
        // Check if the file we are looking for already exists