Skip to content

Commit 2dd8183

Browse files
committed
Avoid leading .. for temporary files from Filesystem recursive remove
1 parent e8b2fb7 commit 2dd8183

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private static function doRemove(array $files, bool $isRecursive): void
170170
}
171171
} elseif (is_dir($file)) {
172172
if (!$isRecursive) {
173-
$tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-.'));
173+
$tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_'));
174174

175175
if (file_exists($tmpName)) {
176176
try {

0 commit comments

Comments
 (0)