Forum Discussion

Inactive User's avatar
Inactive User
12 years ago

Passing a string through the smut filter?

Long story short, we're building a component that allows a user to submit text to a board they don't have access to read. So, we had to use a restadmin call when we do the post action. However, this allows anything to be submitted including scripts, etc. Is there a way that we can run a string through the Lithium filter/validator that the normal post page uses? Thanks. 

2 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    12 years ago

    Hi jlutterloh,

     

    if you want for example to restrict to text - you can in freemarker sanitize the input with 

     

    ${utils.html.stripper.from.gdata.strip("<p>hello <b>world</b><strong>!</strong>")}

     

    Have also a look at this article - applied to a different context but should be the same thing you are aiming to achieve if I understood correctly.

     

    Cheers,

  • Inactive User's avatar
    Inactive User
    12 years ago

    Should have clarified a bit. I knew about the html stripper, but as far as content goes, we'd like to apply the smut filter to this input as well if possible...