Mailto with multiple parameters

Created on 5 July 2024, 5 months ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

We're trying to use this text filter with subject and body parameters, eg `<a href="mailto:a@b.com?subject=hello&body=world">plain</a>`

This gets parsed as expected by php/rot13, but when rendered on the front end, the result also passes through `drupal.checkPlain()`, which causes it to double encode ampersands, thus resulting in `<a href="mailto:a@b.com?subject=hello&amp;amp;body=world">plain</a>` which makes an e-mail client drop the second parameter.

https://git.drupalcode.org/project/obfuscate_email/-/commit/3359c2e5784a...

Steps to reproduce

1. edit a field with the obfuscate email filter enabled to include `<a href="mailto:a@b.com?subject=hello&body=world">plain</a>`
2. preview or save the page
3. click on the email link, note only the subject populates
4. view the source of the page, (Chrome: also need "Edit as HTML"), note the `&amp;amp;` in the link

Proposed resolution

either replace `return Drupal.checkPlain(string);` with a different string manipulation function in `normalizeEncryptEmail` (js) or use a different method of avoiding double encoding of `&` symbols - thanks!

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Fixed

Version

2.1

Component

Code

Created by

🇬🇧United Kingdom vreemt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024