From fc408c0d0687a6a58615a541fd41f3b1e718d034 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 27 Apr 2023 16:47:32 +0200 Subject: [PATCH] wait #5891 @0.25 --- src/Files/VirtualDirectory.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Files/VirtualDirectory.php b/src/Files/VirtualDirectory.php index e3d5c0a..3d2d4c9 100644 --- a/src/Files/VirtualDirectory.php +++ b/src/Files/VirtualDirectory.php @@ -76,9 +76,6 @@ class VirtualDirectory } foreach ($this->_copy as $to => $from) { - if (!file_exists($from)) { - continue; - } if ($delete) { $existing[$to] = true; } @@ -88,9 +85,10 @@ class VirtualDirectory } if (!file_exists($to) || filesize($from) !== filesize($to) || filemtime($from) !== filemtime($to)) { - try { - `cp -p $from $to`; - } catch (\Exception $e) { + $to_esc = escapeshellarg($to); + $from_esc = escapeshellarg($from); + `cp -p $from_esc $to_esc`; + if (!file_exists($to)) { throw new \Exception(sprintf('Failed to copy %s to %s', $from, $to)); } } @@ -107,6 +105,7 @@ class VirtualDirectory if ($delete) { $this->_delete($existing); } + $this->cleanTemp(); } -- 2.39.5