Support » Plugin: Share and Follow » [Plugin: Share and Follow] Ampersand breaks email share

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I’m using Share and Follow version 1.54.1, and characters are still not being properly encoded for use in emails. Can you please fix this problem?

    Here is some code that may help.
    (added to share-and-follow.php line 2024, right after the case “email”: block)… (Of course it is very naughty to edit the plugin’s code directly, so I’m hoping that a fix will be implemented in an update).

    $chars_search = array (
    	'’', 	// single curly quote
    	'“', 	// double curly quote open
    	'”', 	// double curly quote close
    	'…', 	// horizontal ellipsis
    	'&', 	// ampersand
    );
    $chars_replace = array (
    	'%27', 	// single curly quote
    	'%22',	// double curly quote open
    	'%22',  // double curly quote close
    	'%2E%2E%2E', // horizontal ellipsis
    	'%26', 	// ampersand
    );
    $page_title = str_replace( $chars_search, $chars_replace, $page_title );

    This snippet is just a start, but can easily be expanded to handle more characters and subjects.

    Thank you!

    Note: The forum has messed with the code a bit. The strings within the $chars_search array should be the html entity numbers, such as this:

    & # 8 2 1 7;
    & # 8 2 2 0;

    …but without spaces in between each character. See this reference.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Share and Follow] Ampersand breaks email share’ is closed to new replies.