mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
18e83f9c36
commit
2a708450ec
@ -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…
x
Reference in New Issue
Block a user