XF 2.0 bb code that's limited to specific domains?

Freak

Member
I have a custom bbcode that takes a link input and places it between some html tags and then converts it to the format I need. It works fine, however, I'd like to have the bbcode work only if it matches specific names, otherwise the link is not parsed.

It seems like the advanced bbcode setting "Option match regular expression" might work, but it doesn't seem to do anything.. I may be using an incorrect expression, however.

Can this be done? Or could it be done using a callback somehow that does a regex to validate that the domain url matches?

Any help would be greatly appreciated.
 
Just to add a bit more detail, I’m trying to take an mp4 url and have it parse to embed via html. I have that part working. But I’m not sure if any security risks with that code and was thinking maybe restricting the domain would help.

So that begs the follow up question: is there any inherent security risk to using B.B. code to parse a link and include it in html tags to make it play in the browser?

Code:
<video width="480" controls>
  <source src="{text}" type="video/mp4">
Your browser does not support the video tag.
</video>
 
Top Bottom