mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
a587695265
commit
8b6ac49730
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user