Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kim.pepper on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Description:
The drupal_valid_path() method in includes/path.inc has been moved to a PathValidator service.
D7
$is_valid = drupal_valid_path($path);
D8
$is_valid = \Drupal::service('path.validator')->isValid($path);
Impacts:
Module developers
Comments
Url::access()
Is some use cases, drupal_valid_path() would be replaced with
\Drupal\Core\Url::access()
.