Skip to content

Commit

Permalink
Fixed values passed in as an array and flagged
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Croker committed Apr 14, 2021
1 parent 12397e7 commit a8590f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.0.1 - 2021-04-14
### Fixed
- Fixed a bug in which an error could be thrown if values were passed in as an array and a submission was flagged as spam.

## 3.0.0 - 2021-04-13
> {warning} The “Excluded URI Patterns” setting has been removed. Use the new “Exclude Controller Actions” setting instead. [Read more](https://putyourlightson.com/articles/snaptcha-3-released)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-snaptcha",
"description": "Automatically validates forms and prevents spam bots from submitting to your site.",
"version": "3.0.0",
"version": "3.0.1",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/snaptcha",
"license": "proprietary",
Expand Down
12 changes: 11 additions & 1 deletion src/templates/_error.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

{% set title = settings.errorTitle %}

{% macro hiddenInput(name, value) %}
{% if value is iterable %}
{% for val in value %}
{{ _self.hiddenInput(name ~ '[]', val) }}
{% endfor %}
{% else %}
{{ hiddenInput(name, value) }}
{% endif %}
{% endmacro %}


{% block message %}

Expand All @@ -19,7 +29,7 @@ <h2>{{ settings.errorTitle }}</h2>

<form action="" method="post">
{% for name, value in postedValues if name != 'snaptcha' %}
{{ hiddenInput(name, value) }}
{{ _self.hiddenInput(name, value) }}
{% endfor %}

{{ craft.snaptcha.field }}
Expand Down

0 comments on commit a8590f0

Please sign in to comment.