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
Jospeh
Jospeh2w ago
TinyEditor::make('description') ->label('Content') ->extraInputAttributes(['style' => 'height: 500px;']) ->required() ->afterStateUpdated(function ($state, callable $set) { return Purifier::clean($state); }), Is this approach correct?
Lara Zeus
Lara Zeus2w ago
test around and see, its really depend on your use case
Sydd
Sydd2w ago
Maybe use Purifier in lifecycle hook.. beforeCreate..
Jospeh
Jospeh2w ago
I am just learning. Can you give an example of this? How could I do it?
Want results from more Discord servers?
Add your server