fixed chmod mode to apply the umask correctly (closes #749)
authorFabien Potencier <fabien.potencier@gmail.com>
Sun, 10 Jun 2012 13:13:55 +0000 (15:13 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sun, 10 Jun 2012 13:14:14 +0000 (15:14 +0200)
CHANGELOG
lib/Twig/Environment.php

index 95b5a33..83d512d 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,6 @@
 * 1.8.3 (2012-XX-XX)
 
- * n/a
+ * fixed chmod mode to apply the umask correctly
 
 * 1.8.2 (2012-05-30)
 
index 333d667..fb9eac6 100644 (file)
@@ -1094,7 +1094,7 @@ class Twig_Environment
         if (false !== @file_put_contents($tmpFile, $content)) {
             // rename does not work on Win32 before 5.2.6
             if (@rename($tmpFile, $file) || (@copy($tmpFile, $file) && unlink($tmpFile))) {
-                @chmod($file, 0644);
+                @chmod($file, 0666 & ~umask());
 
                 return;
             }