k2 notify and recaptcha error
I use on my joomla website k2 notify plugin, but the form will be sent
also if re-capctha field is empty or not right filled, i found this code
part what work with recaptcha:
if ($params->get('recaptcha') && $user->guest)
{
if (!function_exists('_recaptcha_qsencode'))
{
require_once
(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'recaptchalib.php');
}
$privatekey = $params->get('recaptcha_private_key');
$recaptcha_challenge_field =
isset($_POST["recaptcha_challenge_field"]) ?
$_POST["recaptcha_challenge_field"] : '';
$recaptcha_response_field =
isset($_POST["recaptcha_response_field"]) ?
$_POST["recaptcha_response_field"] : '';
$resp = recaptcha_check_answer($privatekey,
$_SERVER["REMOTE_ADDR"], $recaptcha_challenge_field,
$recaptcha_response_field);
if (!$resp->is_valid)
{
return;
}
}
I have to give return so:
if($_POST['recaptcha_response_field'] == ""){
return;
}
But that not works, can someone give me a idea how can i fix it?
No comments:
Post a Comment