Fix a few bugs with the chat, the code will now work perfectly with the latest TerranQuest client

master
Skylar Ittner 8 years ago
parent e3015f2ade
commit b6fed9d17b

@ -28,7 +28,7 @@ if (!preg_match('/-?[0-9]{1,3}\.[0-9]{2,}/', $VARS['long'])) {
sendError("Longitude (long) is in the wrong format.", true); sendError("Longitude (long) is in the wrong format.", true);
} }
if (GET) { if (is_empty($VARS['msg'])) {
// Get messages // Get messages
if (is_empty($VARS['lat']) || is_empty($VARS['long'])) { if (is_empty($VARS['lat']) || is_empty($VARS['long'])) {
sendError("Missing information.", true); sendError("Missing information.", true);

Binary file not shown.

@ -41,16 +41,6 @@ try {
sendError('Database error. Try again later.', true); sendError('Database error. Try again later.', true);
} }
// Show errors and stuff?
define("DEBUG", false);
// Use POST instead of GET?
if (!is_empty($_GET['post']) && $_GET['post'] == '1') {
define("GET", false);
} else {
define("GET", true);
}
if (!DEBUG) { if (!DEBUG) {
error_reporting(0); error_reporting(0);
@ -58,11 +48,15 @@ if (!DEBUG) {
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', 'On'); ini_set('display_errors', 'On');
} }
$VARS; $VARS;
if (GET) { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$VARS = $_GET;
} else {
$VARS = $_POST; $VARS = $_POST;
define("GET", false);
} else {
$VARS = $_GET;
define("GET", true);
} }
/** /**

@ -1,5 +1,6 @@
<?php <?php
define("DEBUG", false);
define("DB_TYPE", "mysql"); define("DB_TYPE", "mysql");
define("DB_NAME", ""); define("DB_NAME", "");