MyBB Community Forums

Full Version: [Request]Disclose tv MyBB Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Disclose tv it is site who can find paranormal videos like NLO UFO and others.
http://www.disclose.tv
Regular expression:
\[disclosetv\]([0-9]+?)\[/disclosetv\]

Replacement:
<object id="dtvplayer" width="480" height="360"> 	<param name="movie" value="http://www.disclose.tv/swf/player.swf" />  	<param name="wmode" value="transparent" /> 	<param name="allowFullScreen" value="true" />   <param name="allowscriptaccess" value="always" />    	<param name="flashvars"  		value="config=http://www.disclose.tv/videos/config/flv/$1.js" />  	<embed type="application/x-shockwave-flash" width="480" height="360" allowFullScreen="true"  	src="http://www.disclose.tv/swf/player.swf" 	flashvars="config=http://www.disclose.tv/videos/config/flv/$1.js"/></embed></object>
(2011-03-24, 09:19 PM)Aries-Belgium Wrote: [ -> ]Regular expression:
\[disclosetv\](.*?)\[/disclosetv\]

I'll suggest to use ([A-Za-z0-9]+) instead of (.*?)
(2011-03-24, 09:24 PM)Yaldaram Wrote: [ -> ]
(2011-03-24, 09:19 PM)Aries-Belgium Wrote: [ -> ]Regular expression:
\[disclosetv\](.*?)\[/disclosetv\]

I'll suggest to use ([A-Za-z0-9]+) instead of (.*?)

Calculating ranges in regular expression takes longer than just taking any character. But if you want to add some extra check to see if the id is valid, only [0-9]+? would be sufficient as the id only has numbers in it.
Isn't "(.*?)" insecure in some form? I remember being told that. (No clue why.)
It can be in certain cases, like in the [url] it doesn't use (.*?) as then you would be able to do something like [url]" name="test[/url] to set the name variable to test, which could be replaced with a pid or something else to screw it up. So if it's inside quotations it is better to specify.