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/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: 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 {