@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function setCurlTimeout(?int $curl_timeout = null): ReCaptchaBuilder { |
| 123 | 123 | |
| 124 | - if($curl_timeout === null) { |
|
| 124 | + if ($curl_timeout === null) { |
|
| 125 | 125 | $curl_timeout = config('recaptcha.curl_timeout', ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT); |
| 126 | 126 | } |
| 127 | 127 | $this->curl_timeout = $curl_timeout; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | $html .= '<script> |
| 225 | 225 | function biscolabLaravelReCaptcha(token) { |
| 226 | - document.getElementById("' . $formId . '").submit(); |
|
| 226 | + document.getElementById("' . $formId.'").submit(); |
|
| 227 | 227 | } |
| 228 | 228 | </script>'; |
| 229 | 229 | } |
@@ -248,8 +248,8 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | $validate_function = " |
| 250 | 250 | fetch('/" . config('recaptcha.default_validation_route', |
| 251 | - 'biscolab-recaptcha/validate') . "?" . config('recaptcha.default_token_parameter_name', |
|
| 252 | - 'token') . "=' + token, { |
|
| 251 | + 'biscolab-recaptcha/validate')."?".config('recaptcha.default_token_parameter_name', |
|
| 252 | + 'token')."=' + token, { |
|
| 253 | 253 | headers: { |
| 254 | 254 | \"X-Requested-With\": \"XMLHttpRequest\", |
| 255 | 255 | \"X-CSRF-TOKEN\": csrfToken.content |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | 'response' => $response, |
| 315 | 315 | ]); |
| 316 | 316 | |
| 317 | - $url = $this->api_url . '?' . $params; |
|
| 317 | + $url = $this->api_url.'?'.$params; |
|
| 318 | 318 | |
| 319 | 319 | if (function_exists('curl_version')) { |
| 320 | 320 | $curl = curl_init($url); |
@@ -226,8 +226,7 @@ discard block |
||
| 226 | 226 | document.getElementById("' . $formId . '").submit(); |
| 227 | 227 | } |
| 228 | 228 | </script>'; |
| 229 | - } |
|
| 230 | - elseif ($this->version == 'v3') { |
|
| 229 | + } elseif ($this->version == 'v3') { |
|
| 231 | 230 | |
| 232 | 231 | $action = Arr::get($configuration, 'action', 'homepage'); |
| 233 | 232 | |
@@ -237,8 +236,7 @@ discard block |
||
| 237 | 236 | if ($js_custom_validation) { |
| 238 | 237 | |
| 239 | 238 | $validate_function = ($js_custom_validation) ? "{$js_custom_validation}(token);" : ''; |
| 240 | - } |
|
| 241 | - else { |
|
| 239 | + } else { |
|
| 242 | 240 | |
| 243 | 241 | $js_then_callback = Arr::get($configuration, 'callback_then', ''); |
| 244 | 242 | $js_callback_catch = Arr::get($configuration, 'callback_catch', ''); |
@@ -323,8 +321,7 @@ discard block |
||
| 323 | 321 | curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_timeout); |
| 324 | 322 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); |
| 325 | 323 | $curl_response = curl_exec($curl); |
| 326 | - } |
|
| 327 | - else { |
|
| 324 | + } else { |
|
| 328 | 325 | $curl_response = file_get_contents($url); |
| 329 | 326 | } |
| 330 | 327 | |