diff options
-rw-r--r-- | web/process.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/process.php b/web/process.php index 9ba055b..1daaa86 100644 --- a/web/process.php +++ b/web/process.php @@ -5,12 +5,12 @@ require_once "config.php"; + $ipaddress = filter_input(INPUT_SERVER, "REMOTE_ADDR", + FILTER_VALIDATE_IP); + if (RECAPTCHA_ENABLED) { require_once "recaptcha.php"; - - $remoteAddress = filter_input(INPUT_SERVER, - "REMOTE_ADDR", - FILTER_VALIDATE_IP); + $challenge = filter_input(INPUT_POST, "recaptcha_challenge_field", FILTER_UNSAFE_RAW); @@ -19,7 +19,7 @@ FILTER_UNSAFE_RAW); $resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, - $remoteAddress, + $ipaddress, $challenge, $response); @@ -76,8 +76,8 @@ OUTPUT_FORMAT=$outputFormat"; die("Could not connect to database ".mysqli_connect_error()); } - $stmt = $db->prepare("INSERT INTO builds (id, handle) VALUES(?, ?)"); - $stmt->bind_param("ss", $buildID, $handle); + $stmt = $db->prepare("INSERT INTO builds (id, handle, ipaddress) VALUES(?, ?, ?)"); + $stmt->bind_param("sss", $buildID, $handle, $ipaddress); $stmt->execute(); $stmt->close(); $db->close(); |