diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index 0a1a55c..fc19aa0 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1476,16 +1476,16 @@ protected function renderAsLink($alter, $text, $tokens) { $options['entity_type'] = $alter['entity_type']; } - // We now have a heavily processed path and set of options. If the - // original path was user entered, or had token replacement done to it, the - // current Url object may be unroutable and use the 'base:' scheme, + // We now have a heavily processed path as a URI string and set of options. + // If the original path was user entered, or had token replacement done to + // it, the current Url object may be unroutable and use the 'base:' scheme, // which means outbound path processors won't run (e.g., path prefixing - // won't occur). So, check to see if we have a 'base:' path, and then - // extract the path portion and run it throught the path validator service + // won't occur). So, check for to see if we have a 'base:' URI, and then + // extract the path component and run it throught the path validator service // to try to turn it into a routable Url object, so output path processors - // will run. Otherwise, use the path as-is. - if (($i = strpos($path, 'base:')) === 0) { - if (!$final_url = $this->getPathValidator()->getUrlIfValidWithoutAccessCheck(substr($url['path'], 5))) { + // will run. Otherwise, use the Uri as-is and convert it into a Url object. + if (parse_url($path, PHP_URL_SCHEME) === 'base') { + if (!$final_url = $this->getPathValidator()->getUrlIfValidWithoutAccessCheck(parse_url($path, PHP_URL_PATH))) { $final_url = CoreUrl::fromUri($path, $options); } else {