Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML field (redactor) strips out commas from "tel:" links #12

Open
danbrellis opened this issue Nov 9, 2023 · 0 comments
Open

HTML field (redactor) strips out commas from "tel:" links #12

danbrellis opened this issue Nov 9, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@danbrellis
Copy link

Description

When saving a redactor field with a phone number that contains commas (,) it is parsed to remove those commas. This is problematic for conference call-in numbers that use the commas to 'pause' before dialing the dial-in passcode. This is ultimately a result of HTML Purifier and I have opened an issue with them: ezyang/htmlpurifier#388

However, just like Craft will sanitize svgs before running the purifier and then putting them back, I wonder if this is something Craft should handle?

See https://github.com/craftcms/html-field/blob/main/src/HtmlField.php#L198-L213

Alternatively, I would think a BEFORE_PURIFY and AFTER_PURIFY event pair would be practical here so I could santize those links myself. Other ideas or guidance is apperciated.

Steps to reproduce

  1. Create a redactor field with 'purify html' enabled.
  2. Create a hyperlink with the href of tel:+12029910477,,32288696#
  3. Save and see how the href is now tel:+1202991047732288696# (no commas)

Additional info

  • Craft version: Pro 4.5.6.1
  • PHP version: 8.1
  • Plugins & versions: craftcms/redactor (v3.0.4)
@danbrellis danbrellis added the bug Something isn't working label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant