added invalid UUID checking for kml.php

pull/73/head
Jon Sowman 2010-07-29 07:51:32 -07:00
rodzic 09ce261729
commit 23e8cd7e7c
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -16,8 +16,9 @@
require_once("includes/config.inc.php");
require_once("includes/functions.inc.php");
if ( !isset($_GET['uuid']) || $_GET['uuid'] == "0" ) die("Invalid UUID");
if ( !isset($_GET['uuid']) || $_GET['uuid'] == "0" ) die("No UUID supplied to KML generation script");
$uuid = $_GET['uuid'];
if ( strlen($uuid) != 40 || !ctype_alnum($uuid) ) die("The supplied UUID was not a valid SHA1 hash");
$flight_csv = $c_preds_path . $uuid . "/" . $c_flight_csv;
$scenario_file = $c_preds_path . $uuid . "/" . $c_scenario_file;
if ( !file_exists( $flight_csv ) || !file_exists( $scenario_file ) ) die("No prediction data for UUID");