fatkatie Posted April 10, 2017 Share Posted April 10, 2017 This site has a textarea used to accept pasted Youtube embed links. Is there a php function or a 3rd party class/module that will validate html 'snippets'? Link to comment Share on other sites More sharing options...
Psycho Posted April 10, 2017 Share Posted April 10, 2017 I have no idea by what you mean by "html 'snippets'". Validate what exactly. That it is a properly formatted url, that the URL is a youtube link, that the link actually points to a valid resource, that the url doesn't contain any malicious code, etc., etc. Are you only going to allow youtube links? What should happen to other links? You need to come up with very specific requirements. Link to comment Share on other sites More sharing options...
requinix Posted April 10, 2017 Share Posted April 10, 2017 The embed snippets all look the same. Just ask the user for the URL to the video, parse_url() it until you reach the video ID, and make the snippet yourself. Link to comment Share on other sites More sharing options...
fatkatie Posted April 10, 2017 Author Share Posted April 10, 2017 Admin guy... GREAT idea. I couldn't find any validators like this except on-line - with no service interface. Thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.