From e056297f64d4445cff264b9c8e77603298553ae2 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 8 Jan 2023 11:17:18 -0700 Subject: [PATCH 1/2] fixes * BasicCaptcha #587 --- CHANGELOG.md | 6 ++++++ classes/BasicCaptcha.php | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d9c678..0156059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v7.1.2 +## 01/08/2023 + +1. [](#bugfix) + * Fixes issue with multiplication type BasicCaptcha Math Captcha [#587](https://github.com/getgrav/grav-plugin-form/issues/587) + # v7.1.1 ## 11/29/2022 diff --git a/classes/BasicCaptcha.php b/classes/BasicCaptcha.php index 4f5a169..61bc10b 100644 --- a/classes/BasicCaptcha.php +++ b/classes/BasicCaptcha.php @@ -32,20 +32,20 @@ public function getCaptchaCode($length = null): string // calculator if ($operator === '-') { if ($first_num < $second_num) { - $result = "$second_num-$first_num"; - $captcha_code = $second_num-$first_num; + $result = "$second_num - $first_num"; + $captcha_code = $second_num - $first_num; } else { $result = "$first_num-$second_num"; $captcha_code = $first_num - $second_num; } } elseif ($operator === '*') { - $result = "{$first_num}x{$second_num}"; - $captcha_code = $first_num - $second_num; + $result = "{$first_num} x {$second_num}"; + $captcha_code = $first_num * $second_num; } elseif ($operator === '/') { - $result = "$first_num/ second_num"; + $result = "$first_num / second_num"; $captcha_code = $first_num / $second_num; } elseif ($operator === '+') { - $result = "$first_num+$second_num"; + $result = "$first_num + $second_num"; $captcha_code = $first_num + $second_num; } } else { From c6f4069669ae4b417c3551fa6a69ae72f78a1257 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 8 Jan 2023 11:17:39 -0700 Subject: [PATCH 2/2] prepare for release --- blueprints.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints.yaml b/blueprints.yaml index 721487a..84f95c2 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Form slug: form type: plugin -version: 7.1.1 +version: 7.1.2 description: Enables forms handling and processing icon: check-square author: