Project

General

Profile

Actions

Bug #91935

closed

Relative pathes in inline CSS not adapted (page.includeCSS.<file>.inline=1)

Added by Sven Tappert over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-08-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
includeCSS, CSS, inline, path
Complexity:
Is Regression:
Sprint Focus:

Description

Usually relative pathes to fonts and images in CSS files are being adapted by Typo3 when needed. This is usually necessary when compression and concatenation is applied and final CSS files are generated in a subdirectory of typo3temp.

Unfortunately, when using the TypoScript Setup option page.includeCSS.<fileID>.inline = 1 the relative pathes are NOT replaced.

Let's assume an extension user_package with a CSS file and a font file in subdirectories of typo3conf/ext/user_package/Resources/Public/Layout/...

So there are:
  • typo3conf/ext/user_package/Resources/Public/Layout/css/inline-styles.css
  • typo3conf/ext/user_package/Resources/Public/Layout/fonts/localFontFile.eot

The font file will be referenced within inline-styles.css like this:

src: url(../fonts/localFontFile.eot)

When using regular Typo3 concatenation and compression, the final CSS file is located in /typo3temp/assets/compressed/ and the font path will be translated to

src: url(../../../typo3conf/ext/user_package/Resources/Public/Layout/fonts/localFontFile.eot)

This path translation is performed in \TYPO3\CMS\Core\Resource\ResourceCompressor::findAndReplaceUrlPathsByRegex() and works fine.

When using the TypoScript Setup option page.includeCSS.<fileID>.inline = 1 the relative pathes should be replaced as well, to avoid invalid references. Final path translation should be absolute to document root, e. g.:

src: url(/typo3conf/ext/user_package/Resources/Public/Layout/fonts/localFontFile.eot)
Actions #1

Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/65395

Actions #2

Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/65395

Actions #3

Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/65395

Actions #4

Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/65395

Actions #5

Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/65395

Actions #6

Updated by Gerrit Code Review over 3 years ago

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

Actions #7

Updated by Alexander Künzl over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF