From 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:45:02 +0100 Subject: initial checking of customized version 1.0rc9 --- includes/class.recaptcha.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 includes/class.recaptcha.php (limited to 'includes/class.recaptcha.php') diff --git a/includes/class.recaptcha.php b/includes/class.recaptcha.php new file mode 100644 index 0000000..d998d43 --- /dev/null +++ b/includes/class.recaptcha.php @@ -0,0 +1,33 @@ + $fs->prefs['captcha_recaptcha_secret'], + 'response' => $_POST['g-recaptcha-response'] + ); + + $options = array( + 'http' => array ( + 'method' => 'POST', + /* for php5.3, default enctype for http_build_query() was added with php5.4, http://php.net/manual/en/function.http-build-query.php */ + 'header' => 'Content-type: application/x-www-form-urlencoded', + 'content' => http_build_query($data, '', '&') + ) + ); + + $context = stream_context_create($options); + $verify = file_get_contents($url, false, $context); + $captcha_success=json_decode($verify); + + return $captcha_success->success; + } + +} # end class -- cgit v1.2.3-54-g00ecf