Commit a0bcdc25 authored by Riny van Tiggelen's avatar Riny van Tiggelen
Browse files

[BUGFIX] Return expected value on GU::writeFileToTypo3tempDir success

When TYPO3 is in composer mode (var is outside public path),
GeneralUtility::writeFileToTypo3tempDir now returns NULL for
successful operation as stated in the docblock.

Resolves: #90063
Releases: master, 10.4
Change-Id: I670503e68275047f511f3821f97b1b56d62bb7f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68721


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarRiny van Tiggelen <info@online-gamer.nl>
Reviewed-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarRiny van Tiggelen <info@online-gamer.nl>
parent cb84b46c
......@@ -1846,16 +1846,14 @@ class GeneralUtility
static::writeFile($filepath, $content);
if (!@is_file($filepath)) {
$errorMessage = 'The file was not written to the disk. Please, check that you have write permissions to the ' . $prefixLabel . ' directory.';
break;
}
} else {
$errorMessage = 'Calculated file location didn\'t match input "' . $filepath . '".';
break;
}
} else {
$errorMessage = '"' . $dirName . '" is not a directory!';
$errorMessage = 'Calculated file location didn\'t match input "' . $filepath . '".';
break;
}
$errorMessage = '"' . $dirName . '" is not a directory!';
break;
}
return $errorMessage;
}
......
......@@ -2768,6 +2768,9 @@ class GeneralUtilityTest extends UnitTestCase
'Deep directory' => [
Environment::getVarPath() . '/climbing/up/the/walls',
],
'File in typo3temp/var directory' => [
Environment::getPublicPath() . '/typo3temp/var/path/foo.txt'
]
];
}
......
Supports Markdown
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