#109469Broken relative URLs in inline CSS after removal of `getStreamlinedFileName()`
Description
When using PageRenderer::createCssTag() with the inline option enabled, relative URLs inside CSS files are incorrectly rewritten. PageRenderer::createInlineCssTagFromFile() calls fixRelativeUrlPaths() with the absolute file path as the base path. This causes fixRelativeUrlPaths() to treat the file as a directory when resolving relative URIs, resulting in incorrect absolute server paths being embedded in the CSS output.
Steps to Reproduce
1. Add a CSS file in an extension:
EXT:my_ext/Resources/Public/Css/style.css
2. Add a relative asset reference inside the CSS:
@font-face {
font-family: 'MyFont';
src: url('../Fonts/font.woff2') format('woff2');
}
3. Include the CSS via `PageRenderer` with inline enabled:
$pageRenderer->addCssFile(
'EXT:my_ext/Resources/Public/Css/style.css',
'stylesheet',
'all',
'',
true // inline = true
);
4. Render the frontend output
Actual Behavior
The relative URL inside the CSS is rewritten to a filesystem path (starts with double slashes):
//var/www/html/vendor/myvendor/my-ext/Resources/Public/Fonts/font.woff2
This results in broken asset loading in the browser.
Expected Behavior
Relative URLs should be resolved based on the public URI of the CSS file and rewritten to a correct public path such as:
/_assets/<hash>/Fonts/font.woff2Reviews 1
History 48
-
Garvin Hicking changed category Is Regression 1 04/02/26, 16:37
-
Garvin Hicking changed status
NewAccepted 04/06/26, 16:39 -
Gerrit Code Review pushed patch set 1 for main to change 93626 status
AcceptedUnder Review 04/11/26, 12:53 -
Gerrit Code Review pushed patch set 2 for main to change 93626 04/11/26, 12:57
-
Gerrit Code Review pushed patch set 3 for main to change 93626 04/11/26, 13:01
-
Gerrit Code Review pushed patch set 4 for main to change 93626 04/11/26, 13:14
-
Helmut Hummel commented and changed status
Under ReviewResolved done0 %100 % 04/12/26, 14:45 -
Benni Mack changed status
ResolvedClosed 04/21/26, 11:30
Applied in changeset commit:14ae5c7e6d6d1fcdf6304b2dc64c6528c3b80d37.