diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index 087ba0aa1d5..a77c5626667 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -138,9 +138,12 @@ function write($key, &$data, $duration) { $expires = time() + $duration; $contents = $expires . $lineBreak . $data . $lineBreak; + $old = umask(0); + $handle = fopen($this->_File->path, 'a'); + umask($old); - if (!$handle = fopen($this->_File->path, 'a')) { - return false; + if (!$handle) { + return false; } if ($this->settings['lock']) {