diff options
-rw-r--r-- | .htaccess | 1 | ||||
-rw-r--r-- | ajax/maps.ajax.php | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -17,7 +17,6 @@ RewriteRule (.*) http://www.mazetd.4xg.net/$1 [R,L] RewriteRule ^([a-z]+)$ /index\.php?page=$1 [QSA,NC]
# GetMap Re-write
-RewriteRule ^map/(.*)$ /ajax/maps\.ajax\.php?mapid=$1 [QSA,NC]
RewriteRule ^a/map/(.*)$ /ajax/maps\.ajax\.php?mapid=$1 [QSA,NC]
RewriteRule ^a/mapsbydate/(.*)$ /ajax/maps\.ajax\.php?getmapidsbydate=$1 [QSA,NC]
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);
|