Ticket #7690: 7690.9.diff
| File 7690.9.diff, 2.0 KB (added by , 18 years ago) |
|---|
-
wp-admin/includes/class-wp-filesystem-ssh2.php
329 329 function touch($file, $time = 0, $atime = 0) { 330 330 //Not implmented. 331 331 } 332 332 333 333 function mkdir($path, $chmod = null, $chown = false, $chgrp = false) { 334 $path = trim($path, '/'); 334 335 if( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) ) 335 336 return false; 336 337 if( $chown ) … … 463 464 } 464 465 return $ret; 465 466 } 466 467 467 function __destruct(){ 468 468 if ( $this->link ) 469 469 unset($this->link); -
wp-admin/includes/file.php
405 405 for ( $i = count($path) - 1; $i >= 0; $i-- ) { //>=0 as the first element contains data, count()-1, as we do not want the file component 406 406 $tmppath = $to . implode('/', array_slice($path, 0, $i) ); 407 407 if ( $fs->is_dir($tmppath) ) {//Found the highest folder that exists, Create from here 408 for ( $i = $i + 1; $i < count($path); $i++ ) { //< count() no file component please.408 for ( $i = $i + 1; $i <= count($path); $i++ ) { //< count() no file component please. 409 409 $tmppath = $to . implode('/', array_slice($path, 0, $i) ); 410 410 if ( ! $fs->mkdir($tmppath, 0755) ) 411 411 return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); … … 487 487 } 488 488 489 489 if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') ) $method = 'ssh2'; 490 490 491 if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; 491 492 if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread 492 493 return apply_filters('filesystem_method', $method);