silverstripe / silverstripe-admin

Silverstripe Admin Component
BSD 3-Clause "New" or "Revised" License
25 stars 91 forks source link

Email not validating when insert an email link via WYSIWYG. #1707

Closed Jianbinzhu closed 3 months ago

Jianbinzhu commented 3 months ago

Module version(s) affected

2.1.1

Description

When adding an email link via the WYSIWYG, it doesn't not validate or throw an error when a non-email is inputted.

Screenshot 2024-03-12 at 4 38 09 PM

On the front-end, the <a> tag is still being added

Screenshot 2024-03-12 at 4 39 54 PM

How to reproduce

Go to any WYSIWYG, and insert an email link

Screenshot 2024-03-12 at 4 46 54 PM

Possible Solution

No response

Additional Context

I can see that it is being regex checked on https://github.com/silverstripe/silverstripe-admin/blob/2/client/src/legacy/TinyMCE_sslink-email.js#L96, but it simply just removes the value.

Validations

PRs

emteknetnz commented 3 months ago

Linked PR has been merged, it will be automatically tagged shortly for CMS 4. It will be automatically tagged for CMS 5 in within the next week. Ping me if you need it sooner than that and I'll do it manually for you.