Skip to content
Permalink
Browse files

Fixed overwriting of files when Folder::SKIP is set

  • Loading branch information...
angelxmoreno committed Sep 6, 2014
1 parent 07965d6 commit 29570e1d99bac3253c8079cf1651ace58ff8befc
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Utility/Folder.php
@@ -673,7 +673,7 @@ public function copy($options) {
$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));

0 comments on commit 29570e1

Please sign in to comment.
You can’t perform that action at this time.