Classes/Service/RedirectService.php
protected function resolveLinkDetailsFromLinkTarget(string $redirectTarget): array
    {
        // build the target URL, take force SSL into account etc.
        $linkService = GeneralUtility::makeInstance(LinkService::class);
        try {
            $linkDetails = $linkService->resolve($redirectTarget);
            switch ($linkDetails['type']) {
                case LinkService::TYPE_URL:
                    // all set up, nothing to do
                    break;
                case LinkService::TYPE_FILE:
                    /** @var File $file */
                    $file = $linkDetails['file'];
                    if ($file instanceof File) {
                        $linkDetails['url'] = $file->getPublicUrl();
                    }
                    break;
                case LinkService::TYPE_FOLDER:
                    /** @var Folder $folder */
                    $folder = $linkDetails['folder'];
                    if ($folder instanceof Folder) {
                        $linkDetails['url'] = $folder->getPublicUrl();
                    }
                    break;
                default:
                    // we have to return the link details without having a "URL" parameter

            }
        } catch (InvalidPathException $e) {
            return [];
        }
        return $linkDetails;
    }
protected function resolveLinkDetailsFromLinkTarget(string $redirectTarget): array
    {
        // build the target URL, take force SSL into account etc.
        $linkService = GeneralUtility::makeInstance(LinkService::class);
        try {
            $linkDetails = $linkService->resolve($redirectTarget);
            switch ($linkDetails['type']) {
                case LinkService::TYPE_URL:
                    // all set up, nothing to do
                    break;
                case LinkService::TYPE_FILE:
                    /** @var File $file */
                    $file = $linkDetails['file'];
                    if ($file instanceof File) {
                        $linkDetails['url'] = $file->getPublicUrl();
                    }
                    break;
                case LinkService::TYPE_FOLDER:
                    /** @var Folder $folder */
                    $folder = $linkDetails['folder'];
                    if ($folder instanceof Folder) {
                        $linkDetails['url'] = $folder->getPublicUrl();
                    }
                    break;
                default:
                    // we have to return the link details without having a "URL" parameter

            }
        } catch (InvalidPathException $e) {
            return [];
        }
        return $linkDetails;
    }
protected function resolveLinkDetailsFromLinkTarget ( string $ redirectTarget ) : array { // build the target URL, take force SSL into account etc. $ linkService = GeneralUtility :: makeInstance ( LinkService :: class ) ; try { $ linkDetails = $ linkService -> resolve ( $ redirectTarget ) ; switch ( $ linkDetails [ 'type' ] ) { case LinkService :: TYPE_URL : // all set up, nothing to do break ; case LinkService :: TYPE_FILE : /** @var File $file */ $ file = $ linkDetails [ 'file' ] ; if ( $ file instanceof File ) { $ linkDetails [ 'url' ] = $ file -> getPublicUrl ( ) ; } break ; case LinkService :: TYPE_FOLDER : /** @var Folder $folder */ $ folder = $ linkDetails [ 'folder' ] ; if ( $ folder instanceof Folder ) { $ linkDetails [ 'url' ] = $ folder -> getPublicUrl ( ) ; } break ; default : // we have to return the link details without having a "URL" parameter } } catch ( InvalidPathException $ e ) { return [ ] ; } return $ linkDetails ; }
Check if the current request is actually a redirect, and then process the redirect.

@param string $redirectTarget

@return array the link details from the linkService
Check if the current request is actually a redirect and then process the redirect .