I have a php application in which we allow each user to have a “public page” that displays a related video. We have an input text box where they can indicate the html video embed code. The problem we are facing is that if we take this input and immediately show it on the page as it is, all kinds of scripts can be inserted here, leading to a very unsafe system.
We want to allow embed code from all sites, but since they differ in how they are structured, it becomes difficult to keep track of how each of them is structured.
What are the approaches that people have taken to address this scenario? Are there any third-party scripts that do this for you?
source
share