Page MenuHomePhabricator

D9594.id.diff
No OneTemporary

D9594.id.diff

diff --git a/src/filesystem/Filesystem.php b/src/filesystem/Filesystem.php
--- a/src/filesystem/Filesystem.php
+++ b/src/filesystem/Filesystem.php
@@ -587,19 +587,20 @@
* @param string Path to directory. The parent directory must exist and
* be writable.
* @param int Permission umask. Note that umask is in octal, so you
- * should specify it as, e.g., `0777', not `777'. By
- * default, these permissions are very liberal (0777).
- * @param boolean Recursivly create directories. Default to false
+ * should specify it as, e.g., `0777', not `777'.
+ * @param boolean Recursively create directories. Default to false.
* @return string Path to the created directory.
*
* @task directory
*/
- public static function createDirectory($path, $umask = 0777,
+ public static function createDirectory($path, $umask = 0755,
$recursive = false) {
$path = self::resolvePath($path);
if (is_dir($path)) {
- Filesystem::changePermissions($path, $umask);
+ if ($umask) {
+ Filesystem::changePermissions($path, $umask);
+ }
return $path;
}
@@ -626,7 +627,9 @@
// 'The parameter mode specifies the permissions to use. It is modified by
// the process's umask in the usual way: the permissions of the created
// directory are (mode & ~umask & 0777)."'
- Filesystem::changePermissions($path, $umask);
+ if ($umask) {
+ Filesystem::changePermissions($path, $umask);
+ }
return $path;
}

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 15, 7:35 PM (2 d, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714095
Default Alt Text
D9594.id.diff (1 KB)

Event Timeline