From aebdf3ef47a283793013a9da18c25c73458f400a Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Wed, 27 Jul 2011 21:10:52 +0100 Subject: Add missing IP address parameter when creating job entry --- web/process.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'web/process.php') 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(); -- cgit v1.2.3-65-gdbad