Skip to content
Permalink
Browse files

Set umask when creating cache file

Fixes #2080
  • Loading branch information...
0x20h authored and markstory committed Oct 12, 2011
1 parent 6fe24a4 commit b4e3c8a77664b7f4b1ae6318a7ba44c401396e6d
Showing with 5 additions and 2 deletions.
  1. +5 −2 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']) {

0 comments on commit b4e3c8a

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