Issue Bug Closed

#70718cObj imageLinkWrap with absRefPrefix and linkParams result in wrong URL

Andreas Allacher 10/14/15, 20:14 updated 10/21/17, 17:35

Description

Sicne the change https://git.typo3.org/Packages/TYPO3.CMS.git/commit/23df34dc7bd995a5a7ad5f8ee65cde7c828674b2

This line:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#l1816

$url = $this->cObjGetSingle('IMG_RESOURCE', $imgResourceConf);

results in the absRefPrefix to be prepended which will be an issue when calling this line:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#l1859

$string = $this->typoLink($string, $conf['linkParams.']);

As typolink will again prepend the absRefPrefix, this is e.g. an issue with the URL attribute in lightbox when using css_styled_content

To reproduce use the following TypoScript code (make sure the corresponding image exists):

page = PAGE
page.config.absRefPrefix = /
page.10 = IMAGE
page.10 {
    file = fileadmin/test.png
    file.width = 30
    imageLinkWrap = 1
    imageLinkWrap {
         enable = 1
         directImageLink = 1
    }
}

Results in:

<a href="//fileadmin/test.png">
    <img width="30" height="11" border="0" longdesc="" alt="" src="/fileadmin/_processed_/csm_test_5e097abd70.png" style="width: 30px; height: 11px;">
</a>

Reviews 3