F
Filament4mo 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
JospehOP4mo 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 Zeus4mo ago
test around and see, its really depend on your use case
Sydd
Sydd4mo ago
Maybe use Purifier in lifecycle hook.. beforeCreate..
Jospeh
JospehOP4mo ago
I am just learning. Can you give an example of this? How could I do it?

Did you find this page helpful?