diff --git a/cake/libs/folder.php b/cake/libs/folder.php index f36934aec..842b20c92 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -332,13 +332,14 @@ class Folder extends Object{ * @return bool Returns TRUE on success, FALSE on failure */ function chmod($path, $mode = false, $exceptions = false) { - if (!is_dir($path)) { - return chmod($path, intval($mode, 8)); - } if(!$mode) { $mode = $this->mode; } + + if (is_dir($path)) { + return chmod($path, intval($mode, 8)); + } $dir = opendir($path); if($dir) {