WordPress.org

Ready to get started?Download WordPress

Forums

Post Notification
Blog title in email subject contains HTML entities (2 posts)

  1. DaveyM
    Member
    Posted 2 years ago #

    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/

  2. DaveyM
    Member
    Posted 2 years ago #

    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".

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.