0

Is their any good way to ask users to link their you tube videos to my site.

Currently I am doing this in below way,

I have a text area field and help page which asks users to copy the code from youtube site and paste the iframe code in my text area. However this way of doing things I feel is not correct as there exists a risk that people might provide malicious scripts in the text area and I dont do any validation on that field since its optional field in my form.

Can someone suggest better way for implementing this feature ?

4

1 回答 1

0

You should simply accept the video ID number, and validate that it matches ^\d*$.

You should then build the <iframe> tag yourself in your view.

于 2013-05-13T19:40:05.503 回答