Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For instance, if a node has a & in its title, [node:title] will display & instead of & in the mail.
Comment | File | Size | Author |
---|---|---|---|
#4 | stock_notifications_double_escaped-2891350-4-full.patch | 3.58 KB | anrikun |
| |||
#4 | stock_notifications_double_escaped-2891350-4-tests_only.patch | 2.75 KB | anrikun |
Comments
Comment #2
anrikun CreditAttribution: anrikun commentedBut even with a & in product title, stock tests pass though. Problem must be elsewhere.
Comment #3
anrikun CreditAttribution: anrikun commentedGot it. Stock notification tests pass because they are run through TestingMailSystem instead of UbercartMailSystem.
So basically tests are wrong too.
Comment #4
anrikun CreditAttribution: anrikun commentedLet's try these:
1. Updated and fixed tests: should fail
2. Full patch: should pass
Comment #5
TR CreditAttribution: TR commentedThe stock e-mails, and everything else sent with UbercartMailSystem, are assumed to be HTML content. So & *should* be replaced by
&
(single encoding). Are you saying the text actually contains&
(double encoding)?Comment #6
anrikun CreditAttribution: anrikun commentedYes, I mean double encoding.
As HTML is expected, tokens should not be sanitized.
Comment #7
anrikun CreditAttribution: anrikun commented@TR
Here is my stock notifications config (sorry it's in French):
Subject: Seuil de stock atteint pour [node:title] ([uc_stock:model])
Body: Le niveau du stock de l’article [node:title] ([uc_stock:model]) a atteint [uc_stock:level].
And the mail I've received for a product called "Jaked R&R Fenice":