- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-direct.php
r15590 r17926 20 20 * constructor 21 21 * 22 * @param mixed $arg i ngored argument23 */ 24 function WP_Filesystem_Direct($arg) {22 * @param mixed $arg ignored argument 23 */ 24 function __construct($arg) { 25 25 $this->method = 'direct'; 26 26 $this->errors = new WP_Error(); … … 194 194 } 195 195 196 function copy($source, $destination, $overwrite = false ) {196 function copy($source, $destination, $overwrite = false, $mode = false) { 197 197 if ( ! $overwrite && $this->exists($destination) ) 198 198 return false; 199 199 200 return copy($source, $destination); 200 $rtval = copy($source, $destination); 201 if ( $mode ) 202 $this->chmod($destination, $mode); 203 return $rtval; 201 204 } 202 205 … … 217 220 } 218 221 219 function delete($file, $recursive = false ) {222 function delete($file, $recursive = false, $type = false) { 220 223 if ( empty($file) ) //Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem. 221 224 return false; 222 $file = str_replace('\\', '/', $file); //for win32, occasional problems delet eing files otherwise223 224 if ( $this->is_file($file) )225 $file = str_replace('\\', '/', $file); //for win32, occasional problems deleting files otherwise 226 227 if ( 'f' == $type || $this->is_file($file) ) 225 228 return @unlink($file); 226 229 if ( ! $recursive && $this->is_dir($file) ) … … 234 237 if ( is_array($filelist) ) //false if no files, So check first. 235 238 foreach ($filelist as $filename => $fileinfo) 236 if ( ! $this->delete($file . $filename, $recursive ) )239 if ( ! $this->delete($file . $filename, $recursive, $fileinfo['type']) ) 237 240 $retval = false; 238 241
Note: See TracChangeset
for help on using the changeset viewer.