Conditions | 3 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function isValid() { |
||
21 | if (static::$siteKey && static::$secretKey) { |
||
22 | $captcha = Input::post('g-recaptcha-response'); |
||
23 | $response = json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . static::$secretKey . "&response=" . $captcha . "&remoteip=" . Input::server('REMOTE_ADDR')), true); |
||
24 | return (boolean) $response['success']; |
||
25 | } else { |
||
26 | return true; |
||
27 | } |
||
31 |