Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295724

Improve external URL validation in many ways

$
0
0

Problem/Motivation

While working in some issues I realized the need to improve UrlHelper::isValid()( in the file ./core/lib/Drupal/Component/Utility/UrlHelper.php

The issues I've found:

  • Punycode (International Domain Names) URLs cannot be validated
  • It does not accept protocol-relative URLs
  • It does not take in account the allowed protocols because it does not use UrlHelper::getAllowedProtocols()
  • It uses custom regex, while we could use Symfony UrlValidator which has a similar regex

Currently the Symfony UrlValidator also has some issues:

  • It depends of context, which is not available at UrlHelper::isValid()
  • Its code has some bugs displaying the exception's messages

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 295724

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>