From d028f04c2213bb03af98ba5e9357ae18b9ae2a65 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 23 Apr 2013 02:23:26 -0700 Subject: 404 for non-existing maps. --- ajax/maps.ajax.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ajax') 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); -- cgit v1.2.3