D
D
Dmitry Kuznetsov2017-08-25 15:02:10
Laravel
Dmitry Kuznetsov, 2017-08-25 15:02:10

How to secure the output of html from the database + 1 more question?

I did the output of news on my site and faced the problem of displaying the content of the text with html tags.
Those. the user enters text into the news through a visual editor and saves it. I extract the text from the database using {!! $var !!} but this is not safe as all html tags are output. Those. the user can intentionally/accidentally enter bad code there. What is the best way to fix this?
2nd question: which visual editor is better? The main factor is uploading and inserting images.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fomenko_alexandr, 2017-08-25
@fomenko_alexandr

Then, if users also add information, then you can simply write your own bb-codes. And add the necessary tags there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question