WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Post Notification] Blog title in email subject contains HTML entities

[Plugin: Post Notification] Blog title in email subject contains HTML entities

  • If I have a blog with single quotes in the title, e.g. “David’s Test Blog”, and create a post called “David’s Test Post”, the subject of the email sent out is “David’s Test Blog: David's Test Post”.

    To fix this, I have made a change to the function post_notification_create_email() at line 20 of sendmail.php

    Orginally there was

    function post_notification_create_email($id, $template = ''){
    
    	$blogname = get_option('blogname');

    Which I have changed to

    function post_notification_create_email($id, $template = ''){
    
    	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
    	// we want to reverse this for the plain text arena of emails.
    	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    I hope this helps someone,

    David

    http://wordpress.org/extend/plugins/post-notification/

Viewing 1 replies (of 1 total)
  • The example email subject above may be a bit misleading: the HTML entity I provided was converted back to a single quote and unfortunately I don’t appear to be able to edit the post.

    The example should have displayed as “David's Test Blog: David’s Test Post”.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Post Notification] Blog title in email subject contains HTML entities’ is closed to new replies.