Skip to content

Commit

Permalink
Added invisible Captchas support for Forum
Browse files Browse the repository at this point in the history
  • Loading branch information
eSilverStrike committed May 25, 2018
1 parent 56f8fc6 commit 69a43e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/recaptcha/configuration_validation.php
Expand Up @@ -56,7 +56,7 @@
'enable_links' => array('rule' => array('inList', array('0', '1', '2'), true)),

// The plugins below still don't support Invisible reCAPTCHA
'enable_forum' => array('rule' => array('inList', array('0', '1'), true)),
'enable_forum' => array('rule' => array('inList', array('0', '1', '2'), true)),
'enable_mediagallery' => array('rule' => array('inList', array('0', '1'), true)),
'enable_rating' => array('rule' => array('inList', array('0', '1'), true)),
);
5 changes: 4 additions & 1 deletion plugins/recaptcha/functions.inc
Expand Up @@ -250,6 +250,9 @@ function plugin_templatesetvars_recaptcha($type, &$template)

if ($isInvisible) {
$formId = RECAPTCHA_getFormId($type);
if (empty($formId)) {
COM_errorLog(__FUNCTION__ . ': undefined form id for type:"' . $type . '"');
}
$code = <<<JS
var onFormSubmit = function () {
var form = document.getElementById('{$formId}');
Expand Down Expand Up @@ -680,7 +683,7 @@ function RECAPTCHA_getFormId($type) {
break;

case 'forum':
$formId = '';
$formId = 'forumform';
break;

case 'rating':
Expand Down

0 comments on commit 69a43e3

Please sign in to comment.