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

git-svn-id: https://develop.svn.wordpress.org/trunk@9862 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-11-24 20:24:07 +00:00
parent cffae5aabf
commit ce322c83c7

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) {