From 86aac4847705f0a4559400da6c0e9f1aeba5cdf8 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Fri, 10 May 2013 02:17:14 -0700 Subject: Many bugs and PHP notices & warning fixes. --- ajax/chat.ajax.php | 4 ++-- ajax/maps.ajax.php | 2 +- ajax/scores.ajax.php | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'ajax') diff --git a/ajax/chat.ajax.php b/ajax/chat.ajax.php index 97db510..59f7ae3 100644 --- a/ajax/chat.ajax.php +++ b/ajax/chat.ajax.php @@ -9,7 +9,7 @@ if (strtotime('now') - $_SESSION['chatLastReset'] > 6) { $_SESSION['chatSendCount'] = 0; $_SESSION['chatLastReset'] = strtotime('now'); } -if ($_REQUEST['messages']) { +if (isset($_REQUEST['messages'])) { $_SESSION['chatSendCount']++; if ($_SESSION['chatSendCount'] > 4) { $r[0]['error'] = 'Spam'; @@ -40,7 +40,7 @@ require('../includes/chats.php'); $sent = false; -if ($_REQUEST['messages']) { +if (isset($_REQUEST['messages'])) { $date = isMuted($userID); if ($date !== false) { $r[0]['error'] = 'Muted'; diff --git a/ajax/maps.ajax.php b/ajax/maps.ajax.php index 4919fb9..210fd1b 100644 --- a/ajax/maps.ajax.php +++ b/ajax/maps.ajax.php @@ -31,7 +31,7 @@ if (isset($_GET['mapid'])) { function sendCacheHeaders() { $expires = 365*24*60*60; //TODO: Remove this line once we're confident in data in the mapObject. - $expires = 120; + $expires = 31*24*60*60; header("Cache-Control: public, maxage=".$expires); header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT'); header("Content-type: text/javascript"); diff --git a/ajax/scores.ajax.php b/ajax/scores.ajax.php index 897da3b..70d78ff 100644 --- a/ajax/scores.ajax.php +++ b/ajax/scores.ajax.php @@ -22,11 +22,14 @@ $json['page'] = $page; //TODO: Show notifications someplace else! $note = false; -if ($_SESSION['accepted'] == 1) { +if (isset($_SESSION['accepted']) AND $_SESSION['accepted'] == 1) { $userID = $_SESSION['userID']; $note = getNotified($userID); } else { - if ($_SESSION['preCompletedTutorial'] == true && $_SESSION['preCompletedTutorialNotified'] == false) { + if ( + isset($_SESSION['preCompletedTutorial']) && + $_SESSION['preCompletedTutorial'] == true && + $_SESSION['preCompletedTutorialNotified'] == false) { $_SESSION['preCompletedTutorialNotified'] = true; $note = "Tutorial Completed!"; $note .= "
You've unlocked: Blue Wall Color!"; -- cgit v1.2.3