[BUGFIX] Remove hardcoded index.php indexed search links
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / Classes / Controller / SearchController.php
index e31c1b2..3096c76 100644 (file)
@@ -1603,23 +1603,19 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
     protected function preparePageLink(int $pageUid, array $row, array $urlParameters): array
     {
         $target = '';
+        $uri = $this->controllerContext->getUriBuilder()
+                ->setTargetPageUid($pageUid)
+                ->setTargetPageType($row['data_page_type'])
+                ->setUseCacheHash(true)
+                ->setArguments($urlParameters)
+                ->build();
+
         // If external domain, then link to that:
         if (!empty($this->domainRecords[$pageUid])) {
             $scheme = GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://';
             $firstDomain = reset($this->domainRecords[$pageUid]);
-            $additionalParams = '';
-            if (is_array($urlParameters) && !empty($urlParameters)) {
-                $additionalParams = GeneralUtility::implodeArrayForUrl('', $urlParameters);
-            }
-            $uri = $scheme . $firstDomain . '/index.php?id=' . $pageUid . $additionalParams;
+            $uri = $scheme . $firstDomain . $uri;
             $target = $this->settings['detectDomainRecords.']['target'];
-        } else {
-            $uriBuilder = $this->controllerContext->getUriBuilder();
-            $uri = $uriBuilder->setTargetPageUid($pageUid)
-                ->setTargetPageType($row['data_page_type'])
-                ->setUseCacheHash(true)
-                ->setArguments($urlParameters)
-                ->build();
         }
 
         return ['uri' => $uri, 'target' => $target];