Invite module escapes quotation marks and other characters it considers special in the message text, which looks odd in plain text e-mail.

For instance, something like it&39s instead of it's.

CommentFileSizeAuthor
#5 invite-tokens.patch2.64 KBsmk-ka

Comments

mlncn’s picture

Sorry about the other two duplicate posts– I was getting a complete OSUOSL error screen, and never thought it was actually posting when I asked the page to reload.

smk-ka’s picture

Status: Active » Postponed (maintainer needs more info)

Doesn't happen for me. To test it, I've edited the default email template and included an apostrophe as well as an ampersand. Saved and sent an invite: looks ok, ie. plain text with no HTML entities. Could you elaborate on this issue?
--
Stefan Kudwien
unleashed mind

noah10’s picture

To duplicate this problem, try writing the following custom message when you invite someone:

-------------
Dude, it's the best! "Check it out" & you'll see how great it i$!
-------------

The recipient will see HTML entities in place of apostrophes, ampersands, etc. in the message above. I believe the reason for this is the use of @message rather than !message in the template - the '@' tells Drupal to call check_plain when substituting the variable (see http://api.drupal.org/api/5/function/t ), and check_plain replaces some characters with their HTML entities. I'll try to test this and provide a patch if my theory is correct.

mlncn’s picture

Priority: Minor » Normal
Status: Postponed (maintainer needs more info) » Active

Yes, Noah's right, the problem is in user-submitted custom messages, rather than the template. I should have specified.

I hope it is a one-character fix!

benjamin, Agaric Design Collective

smk-ka’s picture

Assigned: Unassigned » smk-ka
Status: Active » Needs review
StatusFileSize
new2.64 KB

This should be true for any other tokens, too. The attached patch includes an update path to change all tokens to the new format, and the required changes to the module itself. Please test.

smk-ka’s picture

I have taken some time to finally implement Token support for Invite. This patch should also fix the bad escaping. This means I'd like to use the patch from #5 as a simple backport for the 4.7x branch, and would like to invite (what else? ;) everyone else to take a look at the linked issue.
--
Stefan Kudwien
unleashed mind

smk-ka’s picture

Status: Needs review » Fixed

Token support has been committed, also fixing this issue.
--
Stefan Kudwien
unleashed mind

Anonymous’s picture

Status: Fixed » Closed (fixed)