SSH2 Upgrade transport: Trim the trailing newline character from the ouput of pwd
to avoid a PHP Segfault.
Fixes #30802 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@31686 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
97ad987b7c
commit
b96b1db015
@ -184,8 +184,9 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
|
||||
public function cwd() {
|
||||
$cwd = $this->run_command('pwd');
|
||||
if ( $cwd )
|
||||
$cwd = trailingslashit($cwd);
|
||||
if ( $cwd ) {
|
||||
$cwd = trailingslashit( trim( $cwd ) );
|
||||
}
|
||||
return $cwd;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user