mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-02 04:30:23 +02:00
Problems with old php versions have been fixed.
This commit is contained in:
@@ -67,9 +67,9 @@ class Server {
|
|||||||
//TODO if contains tileserver.php add to path
|
//TODO if contains tileserver.php add to path
|
||||||
$ru = explode('/', $_SERVER['REQUEST_URI']);
|
$ru = explode('/', $_SERVER['REQUEST_URI']);
|
||||||
$this->config['baseUrls'][0] = $_SERVER['HTTP_HOST'];
|
$this->config['baseUrls'][0] = $_SERVER['HTTP_HOST'];
|
||||||
if (isset($ru[2])) {
|
if (isset($ru[2]) && !empty($ru[2]) && $ru[2] !== 'tms') {
|
||||||
//autodetection for http://server/ or http://server/directory
|
//autodetection for http://server/ or http://server/directory
|
||||||
//subdirectories must be specified $con
|
//subdirectories must be specified $config['baseUrls']
|
||||||
$this->config['baseUrls'][0] = $this->config['baseUrls'][0] . '/' . $ru[1];
|
$this->config['baseUrls'][0] = $this->config['baseUrls'][0] . '/' . $ru[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -512,13 +512,13 @@ class Json extends Server {
|
|||||||
if ($basename == 'index') {
|
if ($basename == 'index') {
|
||||||
$output = '[';
|
$output = '[';
|
||||||
foreach ($maps as $map) {
|
foreach ($maps as $map) {
|
||||||
$output = $output . json_encode($this->metadataTileJson($map), JSON_UNESCAPED_SLASHES) . ',';
|
$output = $output . json_encode($this->metadataTileJson($map)) . ',';
|
||||||
}
|
}
|
||||||
$output = substr_replace($output, ']', -1);
|
$output = substr_replace($output, ']', -1);
|
||||||
} else {
|
} else {
|
||||||
foreach ($maps as $map) {
|
foreach ($maps as $map) {
|
||||||
if (strpos($map['basename'], $basename) !== false) {
|
if (strpos($map['basename'], $basename) !== false) {
|
||||||
$output = json_encode($this->metadataTileJson($map), JSON_UNESCAPED_SLASHES);
|
$output = json_encode($this->metadataTileJson($map));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user