Bug #93466
closedcreateVersionNumberedFilename doesn't support absolute paths
0%
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
Updated by Jonas Renggli almost 4 years ago
- File typo3-cms-core-allow-absolute-paths-in-createVersionNumberedFilename.patch typo3-cms-core-allow-absolute-paths-in-createVersionNumberedFilename.patch added
IMHO the most future proof way to fix this is to extend `createVersionNumberedFilename()` and support absolute paths as well.
Updated by Jonas Renggli over 2 years ago
- Is duplicate of Bug #97939: Version number is not added to filename of backend assets added
Updated by Jonas Renggli over 2 years ago
Fixed in TYPO3 11.5.14.
Updated by Benni Mack almost 2 years ago
- Status changed from New to Closed
Thanks Jonas for the info, will close this issue now.