SSH2 Upgrade transport: Use ssh2_sftp_realpath() instead of shell commands to determine the current directory on the remote server. This should allow it to be used on chrooted SSH sessions.

See #32345


git-svn-id: https://develop.svn.wordpress.org/trunk@32726 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2015-06-12 06:30:58 +00:00
parent 995753d1d0
commit 671218ac1d
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
* @return bool
*/
public function cwd() {
$cwd = $this->run_command('pwd');
$cwd = ssh2_sftp_realpath( $this->sftp_link, '.' );
if ( $cwd ) {
$cwd = trailingslashit( trim( $cwd ) );
}