Skip to content

Commit 84d9352

Browse files
committed
Update recaptcha.php
Changing load order and adding a comment. Proposed by @piotr-cz
1 parent f3a8c11 commit 84d9352

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/captcha/recaptcha/recaptcha.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ public function onInit($id = 'dynamic_recaptcha_1')
5858
}
5959
else
6060
{
61-
$file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag();
62-
JFactory::getDocument()->addScript($file, "text/javascript", true);
61+
// Load callback first for browser compatibility
6362
JHtml::_('script', 'plg_captcha_recaptcha/recaptcha.min.js', false, true);
63+
64+
$file = 'https://www.google.com/recaptcha/api.js?onload=JoomlaInitReCaptcha2&render=explicit&hl=' . JFactory::getLanguage()->getTag();
65+
JHtml::_('script', $file);
6466
}
6567

6668
return true;

0 commit comments

Comments
 (0)