From d4511d02b45725a56c8cc49127244bca640c9d13 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 10 Jun 2012 15:13:55 +0200 Subject: [PATCH] fixed chmod mode to apply the umask correctly (closes #749) --- CHANGELOG | 2 +- lib/Twig/Environment.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 1.7.2.5