Neos.Neos/Classes/Fusion/ConvertUrisImplementation.php
public function evaluate()
    {
        $text = $this->fusionValue('value');

        if ($text === '' || $text === null) {
            return '';
        }

        if (!is_string($text)) {
            throw new Exception(sprintf('Only strings can be processed by this Fusion object, given: "%s".', gettype($text)), 1382624080);
        }

        $node = $this->fusionValue('node');

        if (!$node instanceof NodeInterface) {
            throw new Exception(sprintf('The current node must be an instance of NodeInterface, given: "%s".', gettype($text)), 1382624087);
        }

        if ($node->getContext()->getWorkspace()->getName() !== 'live' && !($this->fusionValue('forceConversion'))) {
            return $text;
        }

        $unresolvedUris = [];
        $linkingService = $this->linkingService;
        $controllerContext = $this->runtime->getControllerContext();

        $absolute = $this->fusionValue('absolute');

        $processedContent = preg_replace_callback(LinkingService::PATTERN_SUPPORTED_URIS, function (array $matches) use ($node, $linkingService, $controllerContext, &$unresolvedUris, $absolute) {
            switch ($matches[1]) {
                case 'node':
                    $resolvedUri = $linkingService->resolveNodeUri($matches[0], $node, $controllerContext, $absolute);
                    $this->runtime->addCacheTag('node', $matches[2]);
                    break;
                case 'asset':
                    $resolvedUri = $linkingService->resolveAssetUri($matches[0]);
                    $this->runtime->addCacheTag('asset', $matches[2]);
                    break;
                default:
                    $resolvedUri = null;
            }

            if ($resolvedUri === null) {
                $unresolvedUris[] = $matches[0];
                return $matches[0];
            }

            return $resolvedUri;
        }, $text);

        if ($unresolvedUris !== []) {
            $processedContent = preg_replace('/<a[^>]* href="(node|asset):\/\/[^"]+"[^>]*>(.*?)<\/a>/', '$2', $processedContent);
            $processedContent = preg_replace(LinkingService::PATTERN_SUPPORTED_URIS, '', $processedContent);
        }

        $processedContent = $this->replaceLinkTargets($processedContent);

        return $processedContent;
    }
public function evaluate()
    {
        $text = $this->fusionValue('value');

        if ($text === '' || $text === null) {
            return '';
        }

        if (!is_string($text)) {
            throw new Exception(sprintf('Only strings can be processed by this Fusion object, given: "%s".', gettype($text)), 1382624080);
        }

        $node = $this->fusionValue('node');

        if (!$node instanceof NodeInterface) {
            throw new Exception(sprintf('The current node must be an instance of NodeInterface, given: "%s".', gettype($text)), 1382624087);
        }

        if ($node->getContext()->getWorkspace()->getName() !== 'live' && !($this->fusionValue('forceConversion'))) {
            return $text;
        }

        $unresolvedUris = [];
        $linkingService = $this->linkingService;
        $controllerContext = $this->runtime->getControllerContext();

        $absolute = $this->fusionValue('absolute');

        $processedContent = preg_replace_callback(LinkingService::PATTERN_SUPPORTED_URIS, function (array $matches) use ($node, $linkingService, $controllerContext, &$unresolvedUris, $absolute) {
            switch ($matches[1]) {
                case 'node':
                    $resolvedUri = $linkingService->resolveNodeUri($matches[0], $node, $controllerContext, $absolute);
                    $this->runtime->addCacheTag('node', $matches[2]);
                    break;
                case 'asset':
                    $resolvedUri = $linkingService->resolveAssetUri($matches[0]);
                    $this->runtime->addCacheTag('asset', $matches[2]);
                    break;
                default:
                    $resolvedUri = null;
            }

            if ($resolvedUri === null) {
                $unresolvedUris[] = $matches[0];
                return $matches[0];
            }

            return $resolvedUri;
        }, $text);

        if ($unresolvedUris !== []) {
            $processedContent = preg_replace('/<a[^>]* href="(node|asset):\/\/[^"]+"[^>]*>(.*?)<\/a>/', '$2', $processedContent);
            $processedContent = preg_replace(LinkingService::PATTERN_SUPPORTED_URIS, '', $processedContent);
        }

        $processedContent = $this->replaceLinkTargets($processedContent);

        return $processedContent;
    }
public function evaluate ( ) { $ text = $ this -> fusionValue ( 'value' ) ; if ( $ text === '' || $ text === null ) { return '' ; } if ( ! is_string ( $ text ) ) { throw new Exception ( sprintf ( 'Only strings can be processed by this Fusion object, given: "%s".' , gettype ( $ text ) ) , 1382624080 ) ; } $ node = $ this -> fusionValue ( 'node' ) ; if ( ! $ node instanceof NodeInterface ) { throw new Exception ( sprintf ( 'The current node must be an instance of NodeInterface, given: "%s".' , gettype ( $ text ) ) , 1382624087 ) ; } if ( $ node -> getContext ( ) -> getWorkspace ( ) -> getName ( ) !== 'live' && ! ( $ this -> fusionValue ( 'forceConversion' ) ) ) { return $ text ; } $ unresolvedUris = [ ] ; $ linkingService = $ this -> linkingService ; $ controllerContext = $ this -> runtime -> getControllerContext ( ) ; $ absolute = $ this -> fusionValue ( 'absolute' ) ; $ processedContent = preg_replace_callback ( LinkingService :: PATTERN_SUPPORTED_URIS , function ( array $ matches ) use ( $ node , $ linkingService , $ controllerContext , & $ unresolvedUris , $ absolute ) { switch ( $ matches [ 1 ] ) { case 'node' : $ resolvedUri = $ linkingService -> resolveNodeUri ( $ matches [ 0 ] , $ node , $ controllerContext , $ absolute ) ; $ this -> runtime -> addCacheTag ( 'node' , $ matches [ 2 ] ) ; break ; case 'asset' : $ resolvedUri = $ linkingService -> resolveAssetUri ( $ matches [ 0 ] ) ; $ this -> runtime -> addCacheTag ( 'asset' , $ matches [ 2 ] ) ; break ; default : $ resolvedUri = null ; } if ( $ resolvedUri === null ) { $ unresolvedUris [ ] = $ matches [ 0 ] ; return $ matches [ 0 ] ; } return $ resolvedUri ; } , $ text ) ; if ( $ unresolvedUris !== [ ] ) { $ processedContent = preg_replace ( '/<a[^>]* href="(node|asset):\/\/[^"]+"[^>]*>(.*?)<\/a>/' , '$2' , $ processedContent ) ; $ processedContent = preg_replace ( LinkingService :: PATTERN_SUPPORTED_URIS , '' , $ processedContent ) ; } $ processedContent = $ this -> replaceLinkTargets ( $ processedContent ) ; return $ processedContent ; }
Convert URIs matching a supported scheme with generated URIs

If the workspace of the current node context is not live, no replacement will be done unless forceConversion is
set. This is needed to show the editable links with metadata in the content module.

@return string
@throws Exception
Convert URIs matching a supported scheme with generated URIs