Assume first match in validate() for request station names

This commit is contained in:
Klaus-Uwe Mitterer 2017-09-16 21:33:22 +02:00
parent 30971e3ade
commit 588fad19d1
1 changed files with 2 additions and 2 deletions

View File

@ -57,8 +57,8 @@ if ($type == "validate") {
} else if ($type == "conn" || $type == "connection" || $type == "connections") {
if ((isset($_GET["from"]) && isset($_GET["to"])) || (isset($_POST["from"]) && isset($_POST["to"]))) {
prepare();
$from = (isset($_GET["from"]) && isset($_GET["to"]) ? $_GET["from"] : $_POST["from"]);
$to = (isset($_GET["from"]) && isset($_GET["to"]) ? $_GET["to"] : $_POST["to"]);
$from = (isset($_GET["from"]) && isset($_GET["to"]) ? $api->validate($_GET["from"])[0]["id"] : $api->validate($_POST["from"])[0]["id"]);
$to = (isset($_GET["from"]) && isset($_GET["to"]) ? $api->validate($_GET["to"])[0]["id"] : $api->validate($_POST["to"])[0]["id"]);
$count = (isset($_GET["count"]) ? $_GET["count"] : (isset($_POST["count"]) ? $_POST["count"] : 3));
$date = (isset($_GET["date"]) ? $_GET["date"] : (isset($_POST["date"]) ? $_POST["date"] : null));
$time = (isset($_GET["time"]) ? $_GET["time"] : (isset($_POST["time"]) ? $_POST["time"] : null));