Problem/Motivation

There is hardly any point maintaining a dragon of a regular expression when Symfony already does the work for us.

Proposed resolution

Just use the regexp in Symfony\Component\Validator\Constraints\UrlValidator::PATTERN

Remaining tasks

Investigate the six remaining failures.

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3217770_2.patch1.77 KBghost of drupal past

Comments

Charlie ChX Negyesi created an issue. See original summary.

ghost of drupal past’s picture

StatusFileSize
new1.77 KB

also, composer.json will need to be edited, larowlan said there's precedent in core/lib/Drupal/Component/Serialization/composer.json

ghost of drupal past’s picture

One of the test failures is https://github.com/symfony/symfony/issues/41599

café.example.org has the é percent encoded.

Where RFCs talk about URIs and IRIs, café is an IRI but not an URI. Sure. But URLs are https://url.spec.whatwg.org/ and that says

The URL code points are ASCII alphanumeric, U+0021 (!), U+0024 ($), U+0026 (&), U+0027 ('), U+0028 LEFT PARENTHESIS, U+0029 RIGHT PARENTHESIS, U+002A (*), U+002B (+), U+002C (,), U+002D (-), U+002E (.), U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+003F (?), U+0040 (@), U+005F (_), U+007E (~), and code points in the range U+00A0 to U+10FFFD, inclusive, excluding surrogates and noncharacters.

And since this is URL and not an URI validator, in my opinion here the test is wrong.

matroskeen’s picture

smustgrave’s picture

Triggering for 10.1

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Seems there are some test failures in the last patch.

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.