Skip to:
Content
Pages
Categories
Search
Top
Bottom

What is the purpose of wp_filter_kses function?


  • jon123456789
    Participant

    @jon123456789

    Hi everyone,

    I was trying to pass some html code through a message and realized that most of the tags and stylistic elements were being stripped away from the content of the message. I did some searching and found that this function “wp_filter_kses” was being applied to all messages. When I removed that filter, nothing was stripped anymore and it worked fine.

    I was just wondering: what is the purpose of that function? Is there some security concern with having people input html/css in messages?

    Also, is there a way to customize what elements/styling gets stripped and what does not get stripped?

    Thanks for your help!

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    It’s a security issue, it sanitizes input.
    More info: http://ottopress.com/2010/wp-quickie-kses/
    Also shows how to allow tags.

    When I removed that filter, nothing was stripped anymore and it worked fine.

    Are you removing it based on how it was added?
    See all the add_filter calls in bp-messages\bp-messages-filters.php
    Use remove_filter to disable specific items.

Viewing 1 replies (of 1 total)
  • The topic ‘What is the purpose of wp_filter_kses function?’ is closed to new replies.
Skip to toolbar