summaryrefslogtreecommitdiffstats
path: root/ajax
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-04-23 02:23:26 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-04-23 02:23:26 -0700
commitd028f04c2213bb03af98ba5e9357ae18b9ae2a65 (patch)
tree2e548ede1c87c33a73be1a7184a07b5eb8127540 /ajax
parentcf370b988c5e90f73d392a605f4779cf2cc688bb (diff)
downloadpathery-d028f04c2213bb03af98ba5e9357ae18b9ae2a65.tar.xz
404 for non-existing maps.
Diffstat (limited to 'ajax')
-rw-r--r--ajax/maps.ajax.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/ajax/maps.ajax.php b/ajax/maps.ajax.php
index 25fbbf8..4919fb9 100644
--- a/ajax/maps.ajax.php
+++ b/ajax/maps.ajax.php
@@ -19,6 +19,10 @@ if (isset($_GET['mapid'])) {
$mapID = $tmp[0] * 1;
if (!is_int($mapID)) exit;
$map = getMapObjectByID($mapID);
+ if ($map == null) {
+ header("Status: 404 Not Found");
+ exit;
+ }
sendCacheHeaders();
echo json_encode($map);
exit;
@@ -44,6 +48,7 @@ function getMapObjectByID($mapID) {
$result = mysql_query($sql);
if (mysql_num_rows($result) > 0) {
list($code, $name, $mapExpireTime) = mysql_fetch_row($result);
+ if ($code == '') return null;
$map = new map($code, $mapID);
$map->name = $name;
$map->dateExpires = strtotime($mapExpireTime);