Forums

Join
bbPress Support ForumsTroubleshootingSlashes being added when using certain symbols

Info

Tags

Slashes being added when using certain symbols

  1. Hi,

    I'm noticing that back-slashes are being added when I use apostrophes or double-quotes in my forum. I've seen this before and I think I fixed it by adding stripslashes() or something around the variable, but I don't know where I'd add it.

    Is this a problem with the theme I'm using rather than bbpress? Any thoughts on how to fix it? Where are the post and title boxes created?

    Thanks.

  2. I've seen that on integrated installations, or when using a language file. Is that your situation?

    This has been reported but I don't recall much about it lately, not a lot any way:
    http://bbpress.org/forums/topic/slashes-being-added-in-front-of-apostrophes#post-3953

  3. Yep, I have it integrated with wordpress. I'll give those fixes a shot.

    Is there anyway I could add them without hacking core? Maybe as a plugin? This post (http://bbpress.org/forums/topic/slashes-being-added-in-front-of-apostrophes#post-12563) suggests adding this:

    if (function_exists('wp_head')) {
      // or another check to see if WordPress has been included
      add_filter('get_topic_title', 'stripslashes');
      add_filter('get_post_text', 'stripslashes');
    }

    to the "WordPress Integration" plugin. Since that plugin is in wordpress, not bbpress it didn't seem like it would work, but I tried anyway and nothing. One person said it worked. Where might they have been adding it?

    Then there is hacking core files, which I'd rather not do since it makes updating more difficult.

  4. I just added the code I pasted above to my theme's header.php file and that seems to have done it. Any reason this is a bad idea?

  5. You must log in to post.