Query string gets lost in HTML method

Created on 13 June 2023, almost 2 years ago

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).

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany mrshowerman Munich

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

Merge Requests

Comments & Activities

  • Issue created by @mrshowerman
  • 🇩🇪Germany mrshowerman Munich

    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.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇩🇪Germany mrshowerman Munich

    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.

Production build 0.71.5 2024