Won't fix bbCodeStrip not stripping BBCodes in this case

Siropu

Well-known member
When using this helper with BBCode like this:
PHP:
XenForo_Helper_String::bbCodeStrip('[BBCodeTag]blabla[/BBCodeTag]');
You get this:
When using this helper with BBCode like this:
PHP:
XenForo_Helper_String::bbCodeStrip('[BBCodeTag]blabla');
You get this:
[BBCodeTag]blabla
Which ends up like this once posted:
[BBCodeTag]blabla[/BBCodeTag]
So basically this helper is useless in this case.
 
Last edited:
Realistically, this function won't change. It's mostly designed as a "quick and dirty" approach to stripping BB code and being wrong in edge cases is acceptable. For example, note that it really just strips things that look like BB code and doesn't respect the rules of the plain tag. Removing unmatched tags would lead to false positives far more often than what it currently misses.

A more accurate BB code removal system is available through XenForo_BbCode_Formatter_BbCode_Strip, though at the cost of it likely being slower.
 
Thank you for your answer. This wouldn't be a problem if the BBCode parser would not parse bbcodes without end tag, but it does. I will have to make a custom helper in this case.
 
Back
Top Bottom