mirror of
https://github.com/danpros/htmly.git
synced 2026-04-21 04:56:23 +05:30
[TASK] added Feature #120
This commit is contained in:
parent
7421b6266e
commit
5eefbe93f8
4 changed files with 39 additions and 2 deletions
|
|
@ -1758,3 +1758,24 @@ function remove_html_comments($content)
|
|||
{
|
||||
return trim(preg_replace('/(\s|)<!--(.*)-->(\s|)/', '', $content));
|
||||
}
|
||||
|
||||
function isCaptcha($reCaptchaResponse){
|
||||
if(! config("google.reCaptcha")){
|
||||
return true;
|
||||
}
|
||||
$url = "https://www.google.com/recaptcha/api/siteverify";
|
||||
$options = array(
|
||||
"secret" => config("google.reCaptcha.private"),
|
||||
"response" => $reCaptchaResponse,
|
||||
"remoteip" => $_SERVER['REMOTE_ADDR'],
|
||||
);
|
||||
$fileContent = @file_get_contents($url . "?" . http_build_query($options));
|
||||
if($fileContent === false) {
|
||||
return false;
|
||||
}
|
||||
$json = json_decode($fileContent, true);
|
||||
if($json == false){
|
||||
return false;
|
||||
}
|
||||
return ($json['success']);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue