XSS Protection with "amidesfahani/filament-tinyeditor" in Laravel Filament V3
I'm using the "amidesfahani/filament-tinyeditor": "^2.0" package. What measures do you use to protect against XSS attacks? Do you have any recommendations or could you help with this?
5 Replies
you can use:
https://github.com/mewebstudio/Purifier
TinyEditor::make('description')
->label('Content')
->extraInputAttributes(['style' => 'height: 500px;'])
->required()
->afterStateUpdated(function ($state, callable $set) {
return Purifier::clean($state);
}),
Is this approach correct?
test around and see, its really depend on your use case
Maybe use Purifier in lifecycle hook.. beforeCreate..
I am just learning. Can you give an example of this? How could I do it?