1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Won't Fix bbCodeStrip not stripping BBCodes in this case

Discussion in 'Resolved Bug Reports' started by Siropu, Oct 17, 2016.

  1. Siropu

    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:
    Which ends up like this once posted:
    So basically this helper is useless in this case.
     
    Last edited: Oct 17, 2016
    bebosny likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
  3. Siropu

    Siropu Well-Known Member

    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.
     

Share This Page