SCP: always encapsulate filenames within double quotes

This commit is contained in:
terrafrost 2014-07-03 13:36:24 -05:00
parent 9edf905939
commit aec33901fc

View File

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