Commit 5e3730b3 authored by Torben Hansen's avatar Torben Hansen Committed by Christian Kuhn
Browse files

[BUGFIX] Fix includeCSS.inline for files with EXT: syntax

The feature page.includeCSS.inline checks the existence
of the given file with `is_file()`. This does not work
for files included with the EXT: prefix, since the
path to the filename is not fully resolved any more
since https://review.typo3.org/c/Packages/TYPO3.CMS/+/71457

This patch processes the given file using the
`getStreamlinedFileName` function in order to resolve
the relative path to the file.

Resolves: #96098
Releases: master, 11.5
Change-Id: I2958eb13228622e724b5d4db1919a982fcd6247e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72324

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 02ee5d16
......@@ -2199,12 +2199,13 @@ class PageRenderer implements SingletonInterface
*/
private function createCssTag(array $properties, string $file): string
{
if (($properties['inline'] ?? false) && @is_file($file)) {
$includeInline = $properties['inline'] ?? false;
$file = $this->getStreamlinedFileName($file, !$includeInline);
if ($includeInline && @is_file($file)) {
$tag = $this->createInlineCssTagFromFile($file, $properties);
} else {
$href = $this->getStreamlinedFileName($file);
$tag = '<link rel="' . htmlspecialchars($properties['rel'])
. '" href="' . htmlspecialchars($href)
. '" href="' . htmlspecialchars($file)
. '" media="' . htmlspecialchars($properties['media']) . '"'
. (($properties['title'] ?? false) ? ' title="' . htmlspecialchars($properties['title']) . '"' : '')
. $this->endingSlash . '>';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment