Author Topic: "Welcome" email disappears when I click on "Save Message" in Message Composition  (Read 3904 times)

ruben

  • Posts: 25
    • View Profile
Dean,

Every time I click on "Save Message" in Message Composition...my message Disappears!

Here's the sequence I've been doing:

- I click on the "List Settings" button

- In "Welcome and Confirmation" ... I tick the "Send welcome email or when confirmed" box

- I click [ Edit Message ]

- I'm now in "Message Composition" box

- I enter my copy into "Subject" and "Text Message"

- I click on the "Save Message" button

My message DISAPPEARS!!!

How do I fix this???

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Ruben,

Your message may have some "fancy" or "smart" quotes or apostrophes, i.e. ones that lean left or right and are not straight up and down, or other special characters that are not handled correctly by LMP's implementation of a PHP (5.4+) function that processes the message.  Remove the funny characters and it should work properly.

Regards
« Last Edit: March 10, 2014, 02:57:28 am by DW »
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
The issue is with the PHP htmlspecialchars function, that returns a blank string when non-ASCII characters are processed.  The saved message data likely still exists in the database but is not displayed in LMP.  If you want to be able to load messages containing smart quotes so you can fix them instead of "losing" them, in editmsg.php (v1.88) do the following:

Change
Code: [Select]
                 <input type=text class=xbox name=txtsubj size=85 style=\"width: 488px\" value=\"".htmlspecialchars($txtsubj)."\"><br>to
Code: [Select]
                 <input type=text class=xbox name=txtsubj size=85 style=\"width: 488px\" value=\"".htmlspecialchars($txtsubj, ENT_SUBSTITUTE, 'ISO-8859-1')."\"><br>
Change
Code: [Select]
      <span class=table_inside_small>Text Message:</span><br><textarea style=\"width: 488px\" class=xarea name=txtcont rows=8 cols=85>".htmlspecialchars($txtcont)."</textarea><br>to
Code: [Select]
      <span class=table_inside_small>Text Message:</span><br><textarea style=\"width: 488px\" class=xarea name=txtcont rows=8 cols=85>".htmlspecialchars($txtcont, ENT_SUBSTITUTE, 'ISO-8859-1')."</textarea><br>
Change
Code: [Select]
      <textarea style=\"width: 488px\" class=xarea name=txthtcont rows=8 cols=85>".htmlspecialchars($txthtcont)."</textarea><br>to
Code: [Select]
      <textarea style=\"width: 488px\" class=xarea name=txthtcont rows=8 cols=85>".htmlspecialchars($txthtcont, ENT_SUBSTITUTE, 'ISO-8859-1')."</textarea><br>
This causes the htmlspecialchars function to substitute non-ASCII characters with a Unicode alternative, exposing the issue.  In LMP v1.88 and previous, Unicode characters will not display correctly and must be fixed before sending.  In the future, LMP will be fully UTF-8 compatible so you will be able to use and send messages containing smart quotes.

Edit: Updated with character set per next post.

Regards
« Last Edit: April 01, 2015, 01:21:54 pm by DW »
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Working with a client who downgraded PHP 5.4 to 5.3 I have discovered that the issue appears to be restricted to PHP 5.4 and above, where the htmlspecialchars function's default character set was made UTF-8, as noted here.  Smart quotes do in fact appear to be supported under ISO-8859-1, used by LMP 1.88 and PHP 5.3.

Therefore, a better workaround than above for PHP 5.4+ might be (replacing $var with the proper variable name for each line):

Code: [Select]
htmlspecialchars($var, ENT_SUBSTITUTE, 'ISO-8859-1')
That way smart quotes may not be substituted with a UTF-8 sequence and need to be normalized.  (Apparently PHP doesn't recognize them as ISO-8859-1 compatible characters in UTF-8 mode.)

The easiest way to avoid the issue is to avoid smart quotes entirely.

The issue will be fixed in a future update when LMP moves to the UTF-8 character set.

Regards
« Last Edit: March 10, 2014, 02:58:25 am by DW »
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting