SCP: add support for file names with spaces

This commit is contained in:
terrafrost 2014-06-26 20:41:43 -05:00
parent 949cfcc867
commit 9edf905939

View File

@ -170,7 +170,9 @@ class Net_SCP
return false;
}
if (!$this->ssh->exec('scp -t ' . $remote_file, false)) { // -t = to
$filename = strpos($remote_file, ' ') !== false ? '"' . $remote_file . '"' : $remote_file;
if (!$this->ssh->exec('scp -t ' . $filename, false)) { // -t = to
return false;
}
@ -245,7 +247,9 @@ class Net_SCP
return false;
}
if (!$this->ssh->exec('scp -f ' . $remote_file, false)) { // -f = from
$filename = strpos($remote_file, ' ') !== false ? '"' . $remote_file . '"' : $remote_file;
if (!$this->ssh->exec('scp -f ' . $filename, false)) { // -f = from
return false;
}