MyBB Community Forums

Full Version: Force close ALL BBCode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
If someone doesn't close the tag, the BBCode won't parse. It doesn't work like HTML in that respect.

Example:

[b]Ladeeda
It uses regex to something that starts with and ends with . it doesn't just str_replace("[b]","<b>",$post['message']); etc.
Toungue
Hmm ok, well the way I worked out works fine at the moment Smile thanks for the replys.
what you did wont do anything though? :\ lol.
(2012-01-05, 10:38 PM)Booher Wrote: [ -> ]what you did wont do anything though? :\ lol.

Lol stut up
I don't see what the problem is? If you don't close the tags you will just see:

[b]your text here
I really failed descriving my issue, it's a project I have.
You're seriously using str_replace and not regex? Have fun with your spaghetti parser.
(2012-01-10, 10:32 PM)itheme Wrote: [ -> ]I really failed descriving my issue, it's a project I have.

That was possibly a small oversight Toungue you should maybe have mentioned that Toungue also, regex is your friend, use it Smile
Pages: 1 2