Ticket #10170: 10170-wp2.8.patch
File 10170-wp2.8.patch, 1.4 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/class-wp-filesystem-direct.php
20 20 function WP_Filesystem_Direct($arg) { 21 21 $this->method = 'direct'; 22 22 $this->errors = new WP_Error(); 23 $this->permission = umask();24 23 } 25 24 function connect() { 26 25 return true; … … 64 63 return true; 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; 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 71 80 if ( ! $recursive ) 72 return @chmod($file, $mode);81 return @chmod($file, $mode); 73 82 if ( ! $this->is_dir($file) ) 74 83 return @chmod($file, $mode); 75 84 //Is a directory, and we want recursive … … 197 206 } 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) ) 209 if ( ! @mkdir($path) ) 204 210 return false; 211 $this->chmod($path, $chmod); 205 212 if ( $chown ) 206 213 $this->chown($path, $chown); 207 214 if ( $chgrp )