Skip to content
This repository

fix setting of permissions when using file cache #241

Closed
wants to merge 2 commits into from

2 participants

Jan Kohlhof Mark Story
cake/libs/cache/file.php
((7 lines not shown))
144 147
 
145  
-		if (!$handle = fopen($this->__File->path, 'a')) {
146  
-		    return false;
147  
-		}
  148
+		if (!$handle) return false;
1
Mark Story Owner

Missing braces here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Mark Story
Owner

Merged in [8947e92]. Thanks again :)

Mark Story markstory closed this October 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  cake/libs/cache/file.php
7  cake/libs/cache/file.php
@@ -141,9 +141,12 @@ function write($key, &$data, $duration) {
141 141
 
142 142
 		$expires = time() + $duration;
143 143
 		$contents = $expires . $lineBreak . $data . $lineBreak;
  144
+		$old = umask(0);
  145
+		$handle = fopen($this->__File->path, 'a');
  146
+		umask($old);
144 147
 
145  
-		if (!$handle = fopen($this->__File->path, 'a')) {
146  
-		    return false;
  148
+		if (!$handle) {
  149
+			return false;
147 150
 		}
148 151
 
149 152
 		if ($this->settings['lock']) {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.