lifomapserver/htdocs/tiles/index.php

15 lines
361 B
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);
}
?>