Project

General

Profile

Actions

Bug #93466

closed

createVersionNumberedFilename doesn't support absolute paths

Added by Jonas Renggli almost 4 years ago. Updated almost 2 years ago.

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

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Just discovered that files in TYPO3 Backend are lacking cache busting, e.g.

https://example.com/typo3/sysext/backend/Resources/Public/Css/backend.css

This used to work in TYPO3 8

https://example.com/typo3/sysext/backend/Resources/Public/Css/backend.css?1599168500

As far as I see, the root cause is `getRegisteredStylesheetFolders()` returning absolute file names, but `createVersionNumberedFilename` expects relative file names and therefore ignores the file completely.

public/typo3/sysext/backend/Classes/Template/ModuleTemplate.php::getRegisteredStylesheetFolders()

    /**
     * Returns an array of all stylesheet directories registered via $TBE_STYLES['skins']
     */
    protected function getRegisteredStylesheetFolders(): array
    {
        $stylesheetDirectories = [];
        foreach ($GLOBALS['TBE_STYLES']['skins'] ?? [] as $skin) {
            foreach ($skin['stylesheetDirectories'] ?? [] as $stylesheetDir) {
                $directory = GeneralUtility::getFileAbsFileName($stylesheetDir);
                if (!empty($directory)) {
                    $stylesheetDirectories[] = $directory;
                }
            }
        }
        return $stylesheetDirectories;
    }

public/typo3/sysext/core/Classes/Utility/GeneralUtility.php::createVersionNumberedFilename()


Files


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #97939: Version number is not added to filename of backend assetsClosed2022-07-14

Actions
Actions

Also available in: Atom PDF