From ab0a98d6beb9fb233f24215e35053d322b946c38 Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Tue, 26 Jan 2021 10:36:36 -0700 Subject: [PATCH 1/3] Fix blade directives Signed-off-by: Micheal Mand #125 added the ability to add nonces to the scripts, but the implementation was not correct --- src/InvisibleReCaptcha.php | 8 ++++++-- src/InvisibleReCaptchaServiceProvider.php | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/InvisibleReCaptcha.php b/src/InvisibleReCaptcha.php index ce1b67e..d21ec73 100644 --- a/src/InvisibleReCaptcha.php +++ b/src/InvisibleReCaptcha.php @@ -2,6 +2,7 @@ namespace AlbertCht\InvisibleReCaptcha; +use Illuminate\Support\Arr; use Symfony\Component\HttpFoundation\Request; use GuzzleHttp\Client; @@ -92,7 +93,7 @@ public function render($lang = null, $nonce = null) { $html = $this->renderPolyfill(); $html .= $this->renderCaptchaHTML(); - $html .= $this->renderFooterJS($lang, $nonce); + $html .= $this->renderFooterJS([$lang, $nonce]); return $html; } @@ -128,8 +129,11 @@ public function renderCaptchaHTML() * * @return string */ - public function renderFooterJS($lang = null, $nonce = null) + public function renderFooterJS($arguments) { + $lang = Arr::get($arguments, 0); + $nonce = Arr::get($arguments, 1); + $html = '