From a1ba05e3151936f883c59bd3e1a19487e3b4cba8 Mon Sep 17 00:00:00 2001 From: Mehdi Bounya Date: Sat, 18 Aug 2018 23:19:24 +0000 Subject: [PATCH 1/3] Fix embarrassing typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6802a8b..5e475d7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This library makes it easy to use [Google's reCAPTCHA V2](https://developers.goo ### Via composer If you have composer installed you can run -```batch +```sh composer require mehdibo/codeigniter-recaptcha ``` From ef905a023778519d9b2968e4d08d557b0ce2da5b Mon Sep 17 00:00:00 2001 From: Mehdi Bounya Date: Sat, 18 Aug 2018 23:43:23 +0000 Subject: [PATCH 2/3] Change Twitter link --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8ccc9b9..e611171 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "name": "Mehdi Bounya", "email": "contact.mehdi@pm.me", "role": "Developer", - "homepage": "https://twitter.com/mehdibounya" + "homepage": "https://twitter.com/bounyamehdi" } ], "require": { @@ -22,4 +22,4 @@ "autoload": { "classmap": ["libraries/Recaptcha.php"] } -} \ No newline at end of file +} From dcd441cabb7d010e2d104256189a09bed7f283f7 Mon Sep 17 00:00:00 2001 From: "F. Kraijenoord" <32488174+bedrijfsportaal@users.noreply.github.com> Date: Wed, 13 Feb 2019 22:35:18 +0100 Subject: [PATCH 3/3] Check if $this->_parameters is set Check if $this->_parameters is set to avoid Warning messages on screen while debugging your application. --- libraries/Recaptcha.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libraries/Recaptcha.php b/libraries/Recaptcha.php index 64d5b4b..68b0750 100644 --- a/libraries/Recaptcha.php +++ b/libraries/Recaptcha.php @@ -189,13 +189,17 @@ public function create_box($attr = NULL) // Add the site key $box .= ' data-sitekey="'. html_escape($this->_site_key) .'"'; - // Add parameters - foreach ($this->_parameters as $parameter => $value){ - // Check if the value is not NULL - if($value !== NULL) - { - // Add it to the box - $box .= ' data-'. html_escape($parameter) .'="'. html_escape($value) .'"'; + // Check if parameters is available + if (!empty($this->_parameters) ) + { + // Add parameters + foreach ($this->_parameters as $parameter => $value){ + // Check if the value is not NULL + if($value !== NULL) + { + // Add it to the box + $box .= ' data-'. html_escape($parameter) .'="'. html_escape($value) .'"'; + } } }