JPluginHelper::importPlugin('captcha');
$dispatcher = JDispatcher::getInstance();
$arr = $dispatcher->trigger('onInit', 'dynamic_recaptcha_1');
echo $arr[0];
<div id="dynamic_recaptcha_1" class="g-recaptcha " data-sitekey="SITEKEY_TOKEN" data-theme="light" data-size="compact"></div>
<div id="dynamic_recaptcha_1" data-sitekey="SITEKEY_TOKEN" data-theme="light" data-size="compact"></div>
Joomla 3.8.2
PHP 7.0.25
Apache
Linux -- 3.13.0-135-generic #184-Ubuntu SMP Wed Oct 18 11:55:51 UTC 2017 x86_64
I think the bug is in plugins/captcha/recaptcha/recaptcha.php line 92
public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '')
{
if ($this->params->get('version', '1.0') === '1.0')
{
return '<div id="' . $id . '" ' . $class . '></div>';
}
else
{
return '<div id="' . $id . '" ' . **str_replace('class="', 'class="g-recaptcha ', $class)**
. ' data-sitekey="' . $this->params->get('public_key', '')
. '" data-theme="' . $this->params->get('theme2', 'light')
. '" data-size="' . $this->params->get('size', 'normal')
. '"></div>';
}
}
The str_replace will only work if $class is containing 'class="', I don't think, that this does make any sense at all.
Labels |
Added:
?
|
Title |
|
Category | ⇒ | com_plugins |
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Information Required |
If this Issue get no Response, it will be closed at 26th January 2018.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-12-27 23:24:11 |
Closed_By | ⇒ | Quy |
Closed_By | Quy | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/18773
@dennisheiden Please test PR #19190.
Per the docblock:
Changing:
to the following should fix this issue: