Auto-closing BBC tags flaw

Started by Dav999, October 26, 2015, 12:16:17 PM

Previous topic - Next topic

Dav999

A few days ago I came across a random post from one of the members on my forum which interestingly enough contained a combination of BBC tags that partially broke the page layout, and caused further posts to appear smaller and aligned right, like this:



The post in question contained the following BBC:
[left][left][left][move][/Right][/right][/right]

As for what exactly happens, a post with the following contents:
#POSTSTART#[left][left][left][move][/right][/right][/right]#POSTEND#

gets converted to the following HTML:
#POSTSTART#<div style="text-align: left;"><div style="text-align: left;"><div style="text-align: left;"><marquee>[/right][/right][/right]#POSTEND#</div></div></div></marquee>

In other words, for some reason the [left] tags get automatically closed before the [marquee] is, causing the browser to insert its own additional </div>s after the </marquee>.

This also works on an unmodded SMF 2.0.11, and I've also tested it on an older 2.1 beta where it also happened. I did some testing around, and while the end [/right] tags get displayed as if they had not been parsed, removing them will make the bug stop occurring. There is nothing in the error log or server logs.

Kindred

not technically a bug...    it's an issue with how the user is entering the BBC tags...

tags can only be entered in a certain order for some combinations.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Dav999

Thanks for the quick reply.

Quote from: Kindred on October 26, 2015, 12:17:46 PM
not technically a bug...    it's an issue with how the user is entering the BBC tags...

tags can only be entered in a certain order for some combinations.
True, it's a completely invalid combination of BBC tags; but this can be abused with multiple posts in a row to make posts so small that they can't even be read anymore (for example in this topic)

margarett

LOLz your members do know how to have some fun :P :P :P

While I agree that it is a weird behavior, I'm pretty sure it can't be "fixed" (if you consider it broken) in either 2.0 or 2.1, realistically... I would suggest that it's impossible to make sure that all outputted HTML is valid...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Oldiesmann

There really isn't anything we can do about invalid combinations of tags like that. Finding every possible combination and putting them in the correct order would be a pain.
Michael Eshom
Christian Metal Fans

Advertisement: