Answer the question
In order to leave comments, you need to log in
How to display html from base in laravel?
Users can send messages to each other. And as an option, they can send a JS code that will screw everything up. But also in messages, for certain reasons, there may be html code with an image (img tag).
If you output like this {{ $message }} , then everything is safe, but the images are not displayed. And if you output like this {!! $message !}}, then the pictures appear, but they write that this is not allowed. Although the JS code is not executed.
How can I correctly display html code, the safety of which I cannot be sure of?
Answer the question
In order to leave comments, you need to log in
Personally, I'm also looking for solutions to this. But I made it so that bbcode would be used when creating a message, and then, where I need to display it, I converted it to html.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question