Add tile ID conversion php file

This commit is contained in:
Markus Koch 2020-04-25 15:56:50 +02:00
parent a4c7833d87
commit 105dc4d3da

View File

@ -1,3 +1,14 @@
<?php <?php
$x = intval($_GET['x']);
$y = intval($_GET['y']);
$z = intval($_GET['z']);
$id = preg_replace("/[^a-z0-9\-]/", "", $_GET['id']);
if (strlen($id) > 30) die();
$hdr = "Location: /maps.linux-forks.de/tiles/$id/$z/" . str_pad($y * (2**$z) + $x, 5, "0", STR_PAD_LEFT) . ".png";
if (isset($_GET["debug"])) {
echo $hdr;
} else {
header($hdr);
}
?> ?>