MyBB Community Forums

Full Version: Matching domain name of the video url in custom mycode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Regular Expression
\[videox\](.*?)\[/videox\]

Replacement
<iframe src='$1' width='700' height='450'></iframe>

I have heard there could be security issues when using this. One issue i have noticed is that it loads the iframe even when the url is invalid.

Is there a way to match domain name of the entered url for example boootube.com so that it doesn't at least load the iframe when an invalid url other than what you have specified is inputted.
have you tried like this?

<iframe src="https://www.x.com/embed/$1' width='700' height='450'></iframe>
(2016-02-03, 09:45 AM)13thLegion Wrote: [ -> ]Is there a way to match domain name of the entered url for example boootube.com so that it doesn't at least load the iframe when an invalid url  other than what you have specified is inputted.

Yes, it's called regex. (.*?) means everything, (https?:\/\/(www\.)?boootube\.com[^"<>]*) a "boootube" link