From 8a9181d8d4bf1171e6eabe8819b4e5beca2900ea Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 9 Mar 2015 04:32:27 +0000 Subject: [PATCH] SSH2 Upgrade transport: Trim the trailing newline character from the ouput of `pwd` to avoid a PHP Segfault. Fixes #30802 for trunk. Built from https://develop.svn.wordpress.org/trunk@31686 git-svn-id: http://core.svn.wordpress.org/trunk@31667 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-ssh2.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-filesystem-ssh2.php b/wp-admin/includes/class-wp-filesystem-ssh2.php index 294440dec9..0de635481a 100644 --- a/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 3d88ee83c1..485a16ddf2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31685'; +$wp_version = '4.2-alpha-31686'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.