Force close ALL BBCode?

Might work. maybe not.
(2012-01-05, 02:19 PM)itheme Wrote: Yo,

So I know have all my HTML stripped and things but now I need to force close all tags for instance if the user doesn't close it won't make the whole page below bold is there anyway to do this?
Got it now
$txt = str_replace("[b]", "<b>", $txt."</b>");
$txt = str_replace("
", "</b>", $txt);
should work right?

Also, you should place the code bit in [ php] tags to stop mybb parsing it Smile

	$txt = str_replace("[b]", "<b>", $txt."</b>");
	$txt = str_replace("[/b]", "</b>", $txt);

Forum Jump:

Users browsing this thread: 1 Guest(s)