URL is not trimmed when there is a space at the end of it

Created on 21 November 2024, about 24 hours ago

Problem/Motivation

I have an entity with a "Link" field. This field is shown in a form with "Link (with attributes)" widget. If I try to create a new entity, or update an existing one, and in this field I add a space at the end, it is not trimmed, and an exception is thrown (BadRequestHttpException: Invalid URI: A URI must not start nor end with ASCII control characters or spaces. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of /vendor/symfony/http-kernel/HttpKernel.php).

It is seemed to be related to this update: https://www.drupal.org/project/drupal/issues/3486195 🐛 An update to symfony/http-foundation plus a trailing space took down the views UI Active

Steps to reproduce

- Add a "Link" field to a type of entity
- Go to "Manage form display"
- Set widget to "Link (with attributes)"
- Create or update an entity of the previous type
- Go to link field and write a URL, and add a space at the end of the string
- Submit the form

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇪🇸Spain fdelgadobdb

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

Comments & Activities

Production build 0.71.5 2024