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: https://develop.svn.wordpress.org/trunk@21223 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
641b92e43d
commit
b47a1a46e5
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user