I am developing a chat application using PHP and jQuery... all messages sent by the chat pair are appended to a <div>
. While doing this, I found that tags such as <script>
can be entered by users. What tags should I avoid while appending the user's message?
Avoid tags that will inject content into the page:
Other tags may be necessary to remove, as well. Maybe you don't want to embed images. These are things that you will need to determine. At the bare minimum, allow <p>
and <br />
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With