Issue 102: Potential race condition when compiling templates
This commit is contained in:
parent
90ce6fda4c
commit
1c563f340b
@ -145,8 +145,10 @@ public static function render($c) {$t = $c; ?>'.$this->template_content.'<?php }
|
||||
fwrite($fp, $this->template_content, strlen($this->template_content));
|
||||
// Lock released, read access is possible
|
||||
flock($fp, LOCK_UN);
|
||||
fflush($fp);
|
||||
fclose($fp);
|
||||
@chmod($this->compiled_template, 0777);
|
||||
clearstatcache();
|
||||
return true;
|
||||
} else {
|
||||
throw new Exception(sprintf(__('Cannot write the compiled template: %s'), $this->compiled_template));
|
||||
|
Loading…
Reference in New Issue
Block a user