]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-filesystem-ftpext.php
WordPress 3.4
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-filesystem-ftpext.php
index ff65d4c354653c639835d86badd1dd7e5b063226..12280304721c792c4eb9888d981f2d21ccaf3437 100644 (file)
@@ -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);
@@ -338,7 +342,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 +387,3 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
                        ftp_close($this->link);
        }
 }
-
-?>