[BUGFIX] Process typolink syntax for redirect target field contents 74/58374/3
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Sat, 22 Sep 2018 20:49:54 +0000 (22:49 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 24 Sep 2018 14:29:04 +0000 (16:29 +0200)
Resolves: #86355
Releases: master
Change-Id: I348a52aaccc481bc928e096d54818c5d572e7e5f
Reviewed-on: https://review.typo3.org/58374
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/redirects/Classes/Service/RedirectService.php

index 0e85d82..5d62e85 100644 (file)
@@ -24,6 +24,7 @@ use TYPO3\CMS\Core\Resource\Exception\InvalidPathException;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Frontend\Service\TypoLinkCodecService;
 use TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder;
 use TYPO3\CMS\Frontend\Typolink\UnableToLinkException;
 
@@ -150,7 +151,9 @@ class RedirectService implements LoggerAwareInterface
     public function getTargetUrl(array $matchedRedirect, array $queryParams)
     {
         $this->logger->debug('Found a redirect to process', $matchedRedirect);
-        $linkDetails = $this->resolveLinkDetailsFromLinkTarget((string)$matchedRedirect['target']);
+        $linkParameterParts = GeneralUtility::makeInstance(TypoLinkCodecService::class)->decode((string)$matchedRedirect['target']);
+        $redirectTarget = $linkParameterParts['url'];
+        $linkDetails = $this->resolveLinkDetailsFromLinkTarget($redirectTarget);
         $this->logger->debug('Resolved link details for redirect', $linkDetails);
         // Do this for files, folders, external URLs
         if (!empty($linkDetails['url'])) {