From: Fabien Potencier Date: Sun, 10 Jun 2012 13:13:55 +0000 (+0200) Subject: fixed chmod mode to apply the umask correctly (closes #749) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=d4511d02b45725a56c8cc49127244bca640c9d13;p=web%2Fkonrad%2Ftwig.git fixed chmod mode to apply the umask correctly (closes #749) --- diff --git a/CHANGELOG b/CHANGELOG index 95b5a33..83d512d 100644 --- 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) diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 333d667..fb9eac6 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -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; }