X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/b3ddbea8a296025a672b3c3ddca158dc51ed8080..e0bf0ae6a149125bedfeaf344114a97d5864e74d:/wp-admin/includes/class-wp-filesystem-ftpext.php diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index ff65d4c3..d0871891 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -247,6 +247,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return false; } function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { + $path = untrailingslashit($path); + if ( empty($path) ) + return false; + if ( !@ftp_mkdir($this->link, $path) ) return false; $this->chmod($path, $chmod); @@ -326,6 +330,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } } + // Replace symlinks formatted as "source -> target" with just the source name + if ( $b['islink'] ) + $b['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $b['name'] ); + return $b; } @@ -338,7 +346,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { } $pwd = @ftp_pwd($this->link); - if ( ! @ftp_chdir($this->link, $path) ) // Cant change to folder = folder doesnt exist + if ( ! @ftp_chdir($this->link, $path) ) // Cant change to folder = folder doesn't exist return false; $list = @ftp_rawlist($this->link, '-a', false); @ftp_chdir($this->link, $pwd); @@ -383,5 +391,3 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { ftp_close($this->link); } } - -?>