Browse Source

Merge pull request #16616 from cakephp/issue-16611

Fix regressing in umask setting when creating folder.
othercorey 3 years ago
parent
commit
4aa99f805f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Filesystem/Folder.php

+ 2 - 1
src/Filesystem/Folder.php

@@ -646,13 +646,14 @@ class Folder
         if ($this->create($nextPathname, $mode)) {
             if (!file_exists($pathname)) {
                 $old = umask(0);
-                umask($old);
                 if (mkdir($pathname, $mode, true)) {
                     $this->_messages[] = sprintf('%s created', $pathname);
+                    umask($old);
 
                     return true;
                 }
                 $this->_errors[] = sprintf('%s NOT created', $pathname);
+                umask($old);
 
                 return false;
             }