diff -u b/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php --- b/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -24,17 +24,6 @@ use DependencySerializationTrait; /** - * Scheme for URIs from user input. - * - * To create a URL for paths from user input that may or may not correspond - * to a valid Drupal route, use Url::fromUserInput(). - * - * @see \Drupal\Core\Url::fromUserInput() - * @see \Drupal\Core\Url::fromInternalUri() - */ - const SCHEME_INTERNAL = 'internal'; - - /** * The URL generator. * * @var \Drupal\Core\Routing\UrlGeneratorInterface @@ -233,7 +222,7 @@ if ((strpos($path, '/') !== 0) && (strpos($path, '#') !== 0) && (strpos($path, '?') !== 0)) { throw new \InvalidArgumentException(String::format('The path @path is not valid as user input. User-input paths must begin with one of the following characters: / # ?', ['@path' => $path])); } - return static::fromUri(static::SCHEME_INTERNAL . ':' . $path, $options); + return static::fromUri('internal:' . $path, $options); } /** @@ -320,7 +309,7 @@ if ($uri_parts['scheme'] === 'entity') { $url = static::fromEntityUri($uri_parts, $uri_options, $uri); } - elseif ($uri_parts['scheme'] === static::SCHEME_INTERNAL) { + elseif ($uri_parts['scheme'] === 'internal') { $url = static::fromInternalUri($uri_parts, $uri_options); } elseif ($uri_parts['scheme'] === 'route') { diff -u b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php --- b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php +++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php @@ -210,7 +210,7 @@ // attribute. // @todo Does RDF need a URL rather than an internal URI here? // @see \Drupal\rdf\Tests\Field\LinkFieldRdfaTest. - $content = str_replace(Url::SCHEME_INTERNAL . ':/', '', $item->uri); + $content = str_replace('internal:/', '', $item->uri); $item->_attributes += array('content' => $content); } } diff -u b/core/modules/menu_link_content/menu_link_content.module b/core/modules/menu_link_content/menu_link_content.module --- b/core/modules/menu_link_content/menu_link_content.module +++ b/core/modules/menu_link_content/menu_link_content.module @@ -58,7 +58,7 @@ /** @var \Drupal\menu_link_content\MenuLinkContentInterface[] $entities */ $entities = \Drupal::entityManager() ->getStorage('menu_link_content') - ->loadByProperties(['link.uri' => Url::SCHEME_INTERNAL . ':/' . $path]); + ->loadByProperties(['link.uri' => 'internal:/' . $path]); foreach ($entities as $menu_link) { $menu_link_manager->updateDefinition($menu_link->getPluginId(), $menu_link->getPluginDefinition(), FALSE); } diff -u b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php --- b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -187,7 +187,7 @@ public function preSave(EntityStorageInterface $storage) { parent::preSave($storage); - if (parse_url($this->link->uri, PHP_URL_SCHEME) === Url::SCHEME_INTERNAL) { + if (parse_url($this->link->uri, PHP_URL_SCHEME) === 'internal') { $this->setRequiresRediscovery(TRUE); } else { diff -u b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/UserPathUri.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/UserPathUri.php --- b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/UserPathUri.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/UserPathUri.php @@ -28,7 +28,7 @@ list($path) = $value; if (parse_url($path, PHP_URL_SCHEME) === NULL) { - return Url::SCHEME_INTERNAL . ':/' . $path; + return 'internal:/' . $path; } return $path; }