I have my website project where users can comment on posts. I want to allow users to submit YouTube videos for example. I want to display them in an iframe so others see a nice window of the video.
But that means that users can exploit the website using all the HTML tags and scripts?
put something like that
< a href="">< script>alert();< /script>">
which would break the site...
What ways do I have around that?
I want to make sure the user cannot use any tags.. but when link is posted it wraps it in the iframe.
One way I thought of is just to put separate input window only for urls which will be wrapped in iframe. but that complicates everything. I would also like to stick with one comment window.