Bug #82149

\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setAbsRefPrefix is missing a leading / in directory search patterns

Added by Wolfgang Klinger over 1 year ago. Updated 10 months ago.

Status:
Under Review
Priority:
Must have
Category:
Frontend
Target version:
-
Start date:
2017-08-21
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

All the frontend classes use PathUtility::getAbsoluteWebPath now, that generates absolute paths with a leading /,
so setAbsRefPrefix fails to replace the paths.

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#4 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#5 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#8 Updated by David Gurk over 1 year ago

Hi, is there any chance to push this bugfix?

#9 Updated by Gerrit Code Review about 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#10 Updated by David Gurk about 1 year ago

Just for documentation. This issue results from a question/conversation of Wolfgang and me in Slack.
https://typo3.slack.com/archives/C025BQLFA/p1503327454000727

Me
Where does TYPO3 7.6 include the absRefPrefix for CSS files?
In the return of TYPO3\CMS\Core\Page\PageRenderer::renderCssFiles() the prefix is missing, but in the final input, I get complete URLs

return:
<link rel="stylesheet" type="text/css" href="typo3conf/ext/project/Resources
/Public/Css/Master.min.1495457195.css" media="screen"

final output
<link rel="stylesheet" type="text/css" href="//webdev.example.de/typo3conf/ext/project/Resources/Public/Css/Master.min.1495457195.css" media="screen">

In TYPO3 8.7 with a similar configuration.
return:
<link rel="stylesheet" type="text/css" href="/typo3conf/ext/project/Resources/Public/Css/Master.min.1502887324.css" media="screen">
final output:
<link rel="stylesheet" type="text/css" href="/typo3conf/ext/project/Resources/Public/Css/Master.min.1502887324.css" media="screen">

Wolfgang Klinger
this is done in `\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setAbsRefPrefix`

Me
I debugged the problem further:

In TYPO3 8.7 in \TYPO3\CMS\Core\Page\PageRenderer::renderCssFiles the / in front of typo3conf/ext/project..." is set with $this->getStreamlinedFileName()
This causes, that \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setAbsRefPrefix can't set the absRefPrefix, since it search for typo3conf/ext/ without leading slash.

In \TYPO3\CMS\Core\Page\PageRenderer::getStreamlinedFileName there is the clause

if ($prepareForOutput) {
$file = GeneralUtility::createVersionNumberedFilename($file);
$file = PathUtility::getAbsoluteWebPath($file);
}

... where PathUtility::getAbsoluteWebPath($file) adds the trailing slash

#11 Updated by Gerrit Code Review about 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#12 Updated by Gerrit Code Review 10 months ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#13 Updated by Gerrit Code Review 10 months ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#14 Updated by Gerrit Code Review 10 months ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#15 Updated by Gerrit Code Review 10 months ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#16 Updated by Gerrit Code Review 10 months ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#17 Updated by Gerrit Code Review 10 months ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#18 Updated by Gerrit Code Review 10 months ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#19 Updated by Gerrit Code Review 10 months ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#20 Updated by Gerrit Code Review 10 months ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

#21 Updated by Gerrit Code Review 10 months ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53759

Also available in: Atom PDF