Wordpress 3.5
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-filesystem-ftpsockets.php
index 1dc170a93c540a665e20eb045506233effc3142a..1c931e19281c5a600c63e294d9b0cf524f3f9da7 100644 (file)
@@ -267,6 +267,10 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
        }
 
        function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
+               $path = untrailingslashit($path);
+               if ( empty($path) )
+                       return false;
+
                if ( ! $this->ftp->mkdir($path) )
                        return false;
                if ( ! $chmod )
@@ -314,6 +318,10 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                                        $struc['files'] = array();
                        }
 
+                       // Replace symlinks formatted as "source -> target" with just the source name
+                       if ( $struc['islink'] )
+                               $struc['name'] = preg_replace( '/(\s*->\s*.*)$/', '', $struc['name'] );
+
                        $ret[ $struc['name'] ] = $struc;
                }
                return $ret;
@@ -323,5 +331,3 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                $this->ftp->quit();
        }
 }
-
-?>