[BUGFIX] Consider subfolder in absolute links
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / ContentObjectRenderer.php
index a83e167..a72f495 100644 (file)
@@ -6243,6 +6243,12 @@ class ContentObjectRenderer {
                                        $urlParts['scheme'] = 'http';
                                        $urlParts['host'] = $this->getEnvironmentVariable('HTTP_HOST');
                                        $urlParts['path'] = '/' . ltrim($urlParts['path'], '/');
+                                       // absRefPrefix has been prepended to $url beforehand
+                                       // so we only modify the path if no absRefPrefix has been set
+                                       // otherwise we would destroy the path
+                                       if ($GLOBALS['TSFE']->absRefPrefix === '') {
+                                               $urlParts['path'] = $this->getEnvironmentVariable('TYPO3_SITE_PATH') . ltrim($urlParts['path'], '/');
+                                       }
                                        $isUrlModified = TRUE;
                                }
                                // Override scheme: