Whitespace after href mailto: breaks the rendered email

Created on 17 June 2021, over 3 years ago
Updated 26 September 2023, about 1 year ago

Problem/Motivation

Spamspan breaks existing mailto: links if they have a whitespace after "mailto: ".

Steps to reproduce

  1. Install Spamspan ^8.1
  2. Enable Spamspan filter for any CKEditor text formatter, enable dot replacement
  3. Paste/add two of this type entries in source code mode:
  4. <p><a href="mailto:my@email.com">my@email.com</a></p>
    <p><a href="mailto: my@email.com">my@email.com</a></p>
  5. Expected:
  6. my@email.com
    my@email.com

  7. Results:
  8. my@email.com
    my [at] email [dot] com">my@email.com

Proposed resolution

Add whitespace fetching to regex after the "mailto:" part.

🐛 Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

🇱🇻Latvia Phonoman

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    Could someone please check, if this issue still exists in 3.x? We need tests for such cases to work fine for now and in the future.

  • 🇩🇪Germany Anybody Porta Westfalica
  • Issue was unassigned.
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: Do we already have a test for this case present? Otherwise it might be added here :)

  • Status changed to Closed: won't fix over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Thinking about this again, a space after the mailto: before the email address is incorrect markup. It's comparable to something like <a href=" https://example.com ">Broken link</a> which is also expected to break.

    So we shouldn't fix this.

  • 🇱🇻Latvia Phonoman

    This is resolved with the ^3.1 versions - links no longer break if the href contains empty spaces around the email.

    And if I remember the issue correctly (been a while), spamspan was crippling the email link/text for users instead of ignoring it.
    Also, your example for the broken link is not broken, it works fine (which is why this was created). :)
    Priority also should've been "Major" as it broke default link behaviour (without spamspan the links would work/look fine) and for users it looked bad.
    Either way, version 3 is working OK now!

  • 🇩🇪Germany Grevil

    @Phonoman thanks for the heads-up! 👍

  • Status changed to Closed: duplicate about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica
Production build 0.71.5 2024