Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unvalid HTML generated for CSRF input #9762

Closed
jimblue opened this issue Mar 20, 2024 · 3 comments
Closed

Unvalid HTML generated for CSRF input #9762

jimblue opened this issue Mar 20, 2024 · 3 comments

Comments

@jimblue
Copy link
Contributor

jimblue commented Mar 20, 2024

Bug description

Hi there,

As explained in the Statamic doc here:

When using form:create tag, Statamic will automatically take care of opening your form with a proper CSRF token .

Unfortunately the generated HTML seems to not be valid:

<input type="hidden" name="_token" value="cN03woeRj5Q0GtlOj7GydsZcRwlyp9VLzfpwDFJZ" autocomplete="off">

As autocomplete="off" should not be used on <input type="hidden">.

How to reproduce

Just create a form with the form:create tag.

Logs

No response

Environment

Environment
Application Name: Jean-Marie Belloteau
Laravel Version: 10.48.3
PHP Version: 8.3.4
Composer Version: 2.7.2
Environment: local
Debug Mode: ENABLED
URL: immersion-pictures.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: null
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: redis
Session: file

Statamic
Addons: 1
Antlers: runtime
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.53.2 PRO

Statamic Addons
statamic/seo-pro: 5.4.1

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

Runtime (default)

Additional details

No response

@jasonvarga
Copy link
Member

As autocomplete="off" should not be used on .

Do you have a source for this?

@jasonvarga
Copy link
Member

This comes directly from Laravel anyway. They intentionally add autocomplete="off". You can read about it here: laravel/framework#48371

@jimblue
Copy link
Contributor Author

jimblue commented Mar 21, 2024

Hi Jason,
Ok thank you for point me to the related Laravel issue. 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants