Bug #48529
closedtypolink cannot create absolute links to local files even if forceAbsoluteUrl property is set
100%
Description
In "tslib_content::forceAbsoluteUrl" is a regular expression used to extract the url parts of the given $url. Unfortunately the pattern does not take care of file links since it detects the following (wrong) url parts.
Given URL "fileadmin/some/file.pdf"
array (size=4) 'scheme' => string '' 'delimiter' => string '://' 'host' => string 'fileadmin' 'path' => string '/some/file.pdf'
The build in function "parse_url" did it like:
array (size=1) 'path' => string 'fileadmin/some/file.pdf'
Some test code:
page = PAGE page { dokType = 0 1112220 = COA 1112220 { 5 = TEXT 5.value = FORCED ABSOLUTE URL: 10 = TEXT 10 { typolink { parameter.data = page:uid forceAbsoluteUrl = 1 forceAbsoluteUrl.scheme = https returnLast = url } wrap = [|], } 20 < .10 20.typolink.parameter > 20.typolink.parameter = / 30 < .20 # this file link is expected to be absolute prefixed! 30.typolink.parameter = fileadmin/some/file.pdf } 20 < .10 20.5.value = REGULAR: 20.10.typolink.forceAbsoluteUrl > }
Updated by Gerrit Code Review over 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21036
Updated by Markus Klein over 10 years ago
- Is Regression set to No
I can confirm the issue, but there is a very easy workaround: prefix the relative path with a slash.
But I agree this is simply not consistent, since if you don't use forceAbsoluteUrl
you must not specify this slash.
Updated by Markus Klein over 10 years ago
Example for clarifying the problem even more.
Assumed URL of the site: http://devserver/
page.20 = TEXT page.20.value = demolink page.20.typolink.parameter = fileadmin/dummy.jpg
Gives href="fileadmin/dummy.jpg"
page.20 = TEXT page.20.value = demolink page.20.typolink.parameter = fileadmin/dummy.jpg page.20.typolink.forceAbsoluteUrl = 1
Gives href="fileadmin/dummy.jpg"
page.20 = TEXT page.20.value = demolink page.20.typolink.parameter = /fileadmin/dummy.jpg page.20.typolink.forceAbsoluteUrl = 1
Gives href="http://devserver/fileadmin/dummy.jpg"
Updated by Gerrit Code Review over 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review over 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review over 10 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review over 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review over 10 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review over 10 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review about 10 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/21036
Updated by Gerrit Code Review about 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34411
Updated by Gerrit Code Review about 10 years ago
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34411
Updated by Markus Klein about 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset dc0fd8125f67168b4c5536515b558d0dc888e00f.