summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--htdocs/tiles/index.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/htdocs/tiles/index.php b/htdocs/tiles/index.php
index 62a2de0..7e0a89b 100644
--- a/htdocs/tiles/index.php
+++ b/htdocs/tiles/index.php
@@ -1,3 +1,14 @@
<?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);
+ }
?>