PluginProbe ʕ •ᴥ•ʔ
reCaptcha by BestWebSoft / 1.18
reCaptcha by BestWebSoft v1.18
1.79 1.80 1.82 1.83 1.84 1.85 1.86 1.87 trunk 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.57 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.70 1.71 1.72 1.73 1.74 1.75 1.78
google-captcha / lib_v2 / src / ReCaptcha / RequestMethod / Curl.php
google-captcha / lib_v2 / src / ReCaptcha / RequestMethod Last commit date
Curl.php 10 years ago Post.php 10 years ago Socket.php 10 years ago SocketPost.php 10 years ago
Curl.php
48 lines
1 <?php
2
3 namespace ReCaptcha\RequestMethod;
4
5 use ReCaptcha\RequestMethod;
6 use ReCaptcha\RequestParameters;
7
8 /**
9 * Sends cURL request to the reCAPTCHA service.
10 */
11 class Curl implements RequestMethod
12 {
13 /**
14 * URL to which requests are sent via cURL.
15 * @const string
16 */
17 const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';
18
19 /**
20 * Submit the cURL request with the specified parameters.
21 *
22 * @param RequestParameters $params Request parameters
23 * @return string Body of the reCAPTCHA response
24 */
25 public function submit(RequestParameters $params)
26 {
27 $handle = curl_init(self::SITE_VERIFY_URL);
28
29 $options = array(
30 CURLOPT_POST => true,
31 CURLOPT_POSTFIELDS => $params->toQueryString(),
32 CURLOPT_HTTPHEADER => array(
33 'Content-Type: application/x-www-form-urlencoded'
34 ),
35 CURLINFO_HEADER_OUT => false,
36 CURLOPT_HEADER => false,
37 CURLOPT_RETURNTRANSFER => true,
38 CURLOPT_SSL_VERIFYPEER => true
39 );
40 curl_setopt_array($handle, $options);
41
42 $response = curl_exec($handle);
43 curl_close($handle);
44
45 return $response;
46 }
47 }
48