Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bed's avatar
Level 1

How to purify Laravel user input ?

I have been using html purify to purify the user data (https://github.com/mewebstudio/Purifier), It works well but when user insert curly braces, every thing blows up. So how to escape curly braces in this packages ?

0 likes
2 replies
ejdelmonico's avatar

I think you may be out of luck. I don't think that package or stevebauman/purify only takes care of HTML related markup. So, I would just create a helper function that converts the curly braces before running the string through the purifier.

bed's avatar
Level 1

Thanks, you saved my time.

Please or to participate in this conversation.