Project

General

Profile

Bug #93466 ยป typo3-cms-core-allow-absolute-paths-in-createVersionNumberedFilename.patch

Jonas Renggli, 2021-02-08 15:43

View differences:

Classes/Utility/GeneralUtility.php
* = TRUE (BE) / "embed" (FE) : modify filename
* = FALSE (BE) / "querystring" (FE) : add timestamp as parameter
*
* @param string $file Relative path to file including all potential query parameters (not htmlspecialchared yet)
* @param string $file Absolute or relative path to file including all potential query parameters (not htmlspecialchared yet)
* @return string Relative path with version filename including the timestamp
*/
public static function createVersionNumberedFilename($file)
{
$lookupFile = explode('?', $file);
$path = self::resolveBackPath(self::dirname(Environment::getCurrentScript()) . '/' . $lookupFile[0]);
if (substr($file, 0, 1) === '/') {
$path = self::resolveBackPath($lookupFile[0]);
} else {
$path = self::resolveBackPath(self::dirname(Environment::getCurrentScript()) . '/' . $lookupFile[0]);
}
$doNothing = false;
if (TYPO3_MODE === 'FE') {
    (1-1/1)