F
Filament3mo ago
Jospeh

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
JospehOP3mo 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 Zeus3mo ago
test around and see, its really depend on your use case
Sydd
Sydd3mo ago
Maybe use Purifier in lifecycle hook.. beforeCreate..
Jospeh
JospehOP3mo 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