Bug #104807
closedgetText path broken for extension paths in v12
0%
Description
Since the second param for sanitize is not set, it does not allow extension paths, thus it won't resolve it.
case 'path': try { $retVal = GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize($key);
In v13 there seems to be a new getText option asset https://review.typo3.org/c/Packages/TYPO3.CMS/+/77018
Can this be backported to v12? Otherwise sanitize should be called with allowed extension paths.
The documentation is pretty clear at what path should do: https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Data.html#path
Updated by Andreas Kießling 3 months ago
- Related to Feature #99203: Re-introduce easy possibility to add paths via TypoScript added
Updated by Jonas Eberle 3 months ago
Can you give a TypoScript example? I have not noticed a change between v11 and v12.
The only peculiarity (by design, since it generates "TYPO3-paths", not actually URLs) is that it does not output the leading "/" of generated URLs thus I am using it like this:
xxx = TEXT xxx { insertData = 1 value ( <script src="/{path : EXT:configure_cookieman/Resources/Public/JavaScript/trackingobject-youtube-consented.js}"></script> ) }
Of course, getText asset would be great to have in v12 and a backport would be appreciated.
Updated by Andreas Kießling 3 months ago
Hi Jonas,
i tried for about half an hour yesterday and then refactored the code to use a FLUIDTEMPLATE.
Now the other variant also works.. and i also get a leading /
10 = TEXT 10.data = path:{$page.favicon.file} 10.wrap ( <link type="image/png" href="|" rel="shortcut icon"> )
Maybe it was just a hickup from the freshly updated instance, i can't reproduce the error now --> Issue can be closed, the code works as expected.
Updated by Garvin Hicking 3 months ago
- Status changed from New to Resolved
Thanks for the feedback+update, closing as requested :)