Changeset 11667
- Timestamp:
- 06/29/2009 08:23:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-direct.php
r10919 r11667 21 21 $this->method = 'direct'; 22 22 $this->errors = new WP_Error(); 23 $this->permission = umask();24 23 } 25 24 function connect() { … … 65 64 } 66 65 function chmod($file, $mode = false, $recursive = false) { 67 if ( ! $mode )68 $mode = $this->permission;69 66 if ( ! $this->exists($file) ) 70 67 return false; 71 if ( ! $recursive ) 72 return @chmod($file,$mode); 68 69 if ( ! $mode ) { 70 if ( $this->permission ) 71 $mode = $this->permission; 72 elseif ( $this->is_file($file) ) 73 $mode = FS_CHMOD_FILE; 74 elseif ( $this->is_dir($file) ) 75 $mode = FS_CHMOD_DIR; 76 else 77 return false; 78 } 79 80 if ( ! $recursive ) 81 return @chmod($file, $mode); 73 82 if ( ! $this->is_dir($file) ) 74 83 return @chmod($file, $mode); … … 198 207 199 208 function mkdir($path, $chmod = false, $chown = false, $chgrp = false){ 200 if ( ! $chmod) 201 $chmod = $this->permission; 202 203 if ( ! @mkdir($path, $chmod) ) 204 return false; 209 if ( ! @mkdir($path) ) 210 return false; 211 $this->chmod($path, $chmod); 205 212 if ( $chown ) 206 213 $this->chown($path, $chown);
Note: See TracChangeset
for help on using the changeset viewer.