Is it possible to filter video embed with htmlspecialchars()

côoX

New Member
I am allowing users to embed videos on their page, but just in case I want to filter the output. To present the video I retrieve the embed statement from the database but when it is filtered, it is presented in raw code. Is there a video friendly way to filter something like this or does anyone have any suggestions on a different way to do it? Thanks in advance for any advice.\[code\]while ($row = $query->fetch(PDO::FETCH_ASSOC)) {$video= htmlspecialchars( $row['video'], ENT_NOQUOTES, 'UTF-8' );}echo "$video";\[/code\]In the database, the video will look like this for example \[code\] <object width="464" height="368" id="669545" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" alt="Aqua Teen Hunger Force - Hand Banana Funny Videos"><param name="movie" value="http://embed.break.com/NjY5NTQ1"></param><param name="allowScriptAccess" value="http://stackoverflow.com/questions/3780266/always"></param><embed src="http://embed.break.com/NjY5NTQ1" type="application/x-shockwave-flash" allowScriptAccess=always width="464" height="368"></embed></object><br><font size=1><a href="http://www.break.com/usercontent/2009/2/Aqua-Teen-Hunger-Force-Hand-Banana-669545.html" target="_blank">Aqua Teen Hunger Force - Hand Banana</a> - Watch more <a href="http://www.break.com" target="_blank">Funny Videos</a></font>\[/code\]
 
Back
Top