Skip to content

Exception Thrown for Arrays #46

Open
@ataylor32

Description

@ataylor32

When I use this code:

{!! Form::text('title', 'Title') !!}

I get this output:

<div class="form-group "><label for="title">Title</label><input type="text" name="title" id="title" class="form-control"></div>

If somebody decides to mess with the HTML using their browser's developer tools, they could change name="title" to name="title[]" and submit the form. If the form doesn't pass validation and the user gets redirected back to the form, the following exception is thrown:

Method NetoJose\Bootstrap4Forms\FormService::__toString() must not throw an exception, caught ErrorException: htmlspecialchars() expects parameter 1 to be string, array given

Granted, this is probably an uncommon scenario, but nevertheless it could happen.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions