Issue with HTML ` ` not being correctly filtered out from URLs

Created on 8 May 2024, 10 months ago

Problem/Motivation

Hey, After updating to Drupal 10.2.5, I've encountered an issue in one of my projects where our automated tests related to the HTML filter are failing. The problem arises with HTML content that includes a non-breaking space (` `) within a URL, which should not be part of the URL.

Steps to reproduce

In our content, we have a `p` element with a URL that includes a non-breaking space at the end:

For details of the Last Post Service: https://www.shrine.org.au/last-post-service-31-july 

Current output:

`For details of the Last Post Service: https://www.shrine.org.au/last-post-service-31-july `

Expected output:

`For details of the Last Post Service: https://www.shrine.org.au/last-post-service-31-july `

Temporary workaround:
I managed to resolve this issue temporarily by adding the following line in core/lib/Drupal/Component/Utility/Html::serialize just before the return statement:
`$html = html_entity_decode($html, ENT_QUOTES, 'UTF-8');`

I am looking for guidance or confirmation on whether this is an issue with the recent updates and if there is a planned fix for future releases. Any suggestions on alternative solutions or patches would also be greatly appreciated.

Thank you!

🐛 Bug report
Status

Active

Version

10.2

Component
Base 

Last updated 37 minutes ago

Created by

🇦🇺Australia yovince Melbourne

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024