require_once __DIR__ . '/../../../src/push-to-my-ouya-helpers.php';
$ip = $_SERVER['REMOTE_ADDR'];
-if ($ip == '' || strpos($ip, ':') !== false) {
- //empty or IPv6
+if ($ip == '') {
+ //empty ip
+ header('X-Fail-Reason: empty ip address');
header('HTTP/1.0 204 No Content');
exit(1);
}
$ip = mapIp($ip);
$game = $_GET['game'];
-$cleanGame = preg_replace('#[^a-zA-Z0-9.]#', '', $game);
+$cleanGame = preg_replace('#[^a-zA-Z0-9._]#', '', $game);
if ($game != $cleanGame || $game == '') {
header('HTTP/1.0 400 Bad Request');
header('Content-type: text/plain');
$db = new SQLite3($dbFile, SQLITE3_OPEN_READWRITE);
} catch (Exception $e) {
//db file not found
+ header('X-Fail-Reason: database file not found');
header('HTTP/1.0 204 No Content');
exit(1);
}