WP_Filesystem: Return symlinked directory names correctly, previously the FTP extensions would return it as 'source -> dest' instead of simply 'source'. Props kurtpayne. Fixes #17846

git-svn-id: http://core.svn.wordpress.org/trunk@21223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2012-07-06 11:39:39 +00:00
parent 18e83f9c36
commit 2a708450ec
2 changed files with 8 additions and 0 deletions

View File

@ -330,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;
}

View File

@ -318,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;