WordPress.org

Support

Support » Plugins and Hacks » [Resolved] HTML entities in comments

[Resolved] HTML entities in comments

  • Adam Brown

    @adamrbrown

    I made a plugin for my blog that replicates the backticks function available here on the forum. It’s a simple little plugin. As you can guess it uses htmlspecialchars() (among other things) on the stuff in the backticks. But I found something weird.

    If a comment contains ' in it, it doesn’t post. (Incidentally, I’m having trouble pasting it here, but you can probably tell what I mean–remove the “amp;” from the entity.) You hit submit, and WP just reloads the current post without posting the comment. (It’s not in the moderation/spam queues, it’s just gone.)

    Any ideas?

    EDIT: It took me a few tries to get the entity to paste. It’s there now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Dalton Rooney

    @daltonrooney

    Hey, would you be interested in sharing that plugin?

    Adam Brown

    @adamrbrown

    Certainly. I’ve got some wrapping up to do with it, though. I’ll post a note here when it’s ready:

    http://adambrown.info/b/widgets/

    As for the problem I posted about, I’ve got a nasty workaround that uses both an early and a late filter to insert the correct entity. But if anybody knows why comments don’t post with th #39; entity in them, that would be awesome…

    This is a WPMU 1.2.5a setup, but most of the code (almost certainly all parts relevant to my question) are from the WP 2.2+ series.

    Adam Brown

    @adamrbrown

    As promised, you can now get it here:

    kb backtick comments

    The functionality should all be fine, although I haven’t spent a great deal of time making the CSS perfect, so it might look a little funky depending on your browser.

    But I figure people will need to adjust the plugin’s CSS on a theme-by-theme basis, so it doesn’t make much sense for me to waste time on it.

    Dalton Rooney

    @daltonrooney

    Fantastic, thank you. I’m going to give this a try right now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] HTML entities in comments’ is closed to new replies.
Skip to toolbar