Skip to content

Commit

Permalink
Merge pull request #270 from rossriley/hotfix/prevent-duplicate-attri…
Browse files Browse the repository at this point in the history
…butes

Exclude handled attributes from the general list in form_start
  • Loading branch information
jadwigo committed Nov 8, 2018
2 parents babba49 + 24a636f commit 4926eb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion templates/form/_form_theme.twig
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ templates:
{%- else -%}
{% set form_method = "POST" %}
{%- endif -%}
<form name="{{ name }}" method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
<form name="{{ name }}"
method="{{ form_method|lower }}"
{% if action != '' %} action="{{ action }}"{% endif %}
{% for attrname, attrvalue in attr if attrname not in ['name', 'method', 'enctype'] %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
{% if multipart %} enctype="multipart/form-data"{% endif %}
>
{%- if form_method != method -%}
<input type="hidden" name="_method" value="{{ method }}" />
{%- endif -%}
Expand Down

0 comments on commit 4926eb1

Please sign in to comment.