Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15461222
D9594.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9594.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 2, 6:19 AM (2 w, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7653547
Default Alt Text
D9594.diff (1 KB)
Attached To
Mode
D9594: Don't create directories as `0777` by default.
Attached
Detach File
Event Timeline
Log In to Comment