From 29570e1d99bac3253c8079cf1651ace58ff8befc Mon Sep 17 00:00:00 2001 From: "Angel S. Moreno" Date: Sat, 6 Sep 2014 18:32:45 -0400 Subject: [PATCH] Fixed overwriting of files when Folder::SKIP is set --- lib/Cake/Utility/Folder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Folder.php b/lib/Cake/Utility/Folder.php index f79c4ac51..7d768dff4 100644 --- a/lib/Cake/Utility/Folder.php +++ b/lib/Cake/Utility/Folder.php @@ -673,7 +673,7 @@ class Folder { $to = Folder::addPathElement($toDir, $item); if (($options['scheme'] != Folder::SKIP || !is_dir($to)) && !in_array($item, $exceptions)) { $from = Folder::addPathElement($fromDir, $item); - if (is_file($from)) { + if (is_file($from) && (!is_file($to) || $options['scheme'] != Folder::SKIP)) { if (copy($from, $to)) { chmod($to, intval($mode, 8)); touch($to, filemtime($from));