Problem/Motivation

Sometimes we want to add subject and body parameters to an email address, so they get used by the user's mail client to prepopulate the subject and text fields in a newly opened email.

When using the HTML obfuscating method, these parameters get lost.

Steps to reproduce

Use an email of the form foo@example.com?subject=Bar&body=Baz in a text field. Apply the Obfuscate filter. Open the page and you will see only the bare email (foo@example.com).

Issue fork obfuscate-3366415

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mrshowerman created an issue. See original summary.

mrshowerman’s picture

StatusFileSize
new4.26 KB

I noticed that the query string is available in the $extra array, whose contents are added to the resulting <a> element as HTML attributes. The attached patch fixes the issue by adding the query string to the URL instead and removing it from the array. Also, I noticed a few code inconsistencies introduced by the latest rewrite, which I tried to fix as well.

mrshowerman’s picture

Assigned: mrshowerman » Unassigned
Status: Active » Needs review

mrshowerman’s picture

I noticed that in the HTML method, there were a few attributes added to the link that aren't valid HTML, like type="mailto". On the other hand, other valid attributes got lost in the pre and post keys that were not processed properly.

Created an MR that fixes both on top of the original patch.