Permalink
Browse files

Set umask when creating cache file

Fixes #2080
  • Loading branch information...
1 parent 6fe24a4 commit b4e3c8a77664b7f4b1ae6318a7ba44c401396e6d @0x20h 0x20h committed with markstory Oct 12, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 cake/libs/cache/file.php
View
@@ -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.