From 09101f7397b09fe5244088120f5501b1ee3dff81 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 26 Feb 2020 09:20:51 -0500 Subject: [PATCH] [6.x] Change File cache store permission to not chmod if not set. (#31593) * Change cache filesystem permission so if the config is not set it does not issue a chmod call. This reverts some of the behavior in 61b5aa1895dd4eab26c7e45fcc8e69f0c408cbab From pull request #31579 * Update FileStore.php Co-authored-by: Graham Campbell --- src/Illuminate/Cache/FileStore.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Cache/FileStore.php b/src/Illuminate/Cache/FileStore.php index 30a51595e759..d7e3a2e21c1e 100755 --- a/src/Illuminate/Cache/FileStore.php +++ b/src/Illuminate/Cache/FileStore.php @@ -28,7 +28,7 @@ class FileStore implements Store /** * Octal representation of the cache file permissions. * - * @var int + * @var int|null */ protected $filePermission; @@ -44,7 +44,7 @@ public function __construct(Filesystem $files, $directory, $filePermission = nul { $this->files = $files; $this->directory = $directory; - $this->filePermission = $filePermission ?? 0775; + $this->filePermission = $filePermission; } /** @@ -75,7 +75,9 @@ public function put($key, $value, $seconds) ); if ($result !== false && $result > 0) { - $this->files->chmod($path, $this->filePermission); + if (! is_null($this->filePermission)) { + $this->files->chmod($path, $this->filePermission); + } return true; }