Fix SSH2 fs exists() method. Props ydekproductions. fixes #8331

git-svn-id: http://svn.automattic.com/wordpress/trunk@9862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-11-24 20:24:07 +00:00
parent a587695265
commit 8b6ac49730
1 changed files with 2 additions and 3 deletions

View File

@ -161,7 +161,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
$data .= $buf;
}
fclose($stream);
$data = str_replace("__COMMAND_FINISHED__", "", $data);
$data = trim(str_replace("__COMMAND_FINISHED__", "", $data));
if (($returnbool) && ( (int) $data )) {
return true;
} elseif (($returnbool) && (! (int) $data )) {
@ -311,8 +311,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
function exists($file) {
$this->debug("exists();");
$list = $this->run_command($this->link, sprintf('ls -lad %s', $file));
return (bool) $list;
return $this->run_command($this->link, sprintf('ls -lad %s', $file), true);
}
function is_file($file) {