mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-30 02:28:31 +00:00
Suppress Warning messages
Warning messages would appear if recursive deletes or chmods were attempted. Also, doing pwd() when . was / would return //.
This commit is contained in:
parent
35d6910bf3
commit
eba3fbe13e
@ -592,7 +592,11 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
|
|
||||||
// if $this->pwd isn't set than the only thing $realpath could be is for '.', which is pretty much guaranteed to
|
// if $this->pwd isn't set than the only thing $realpath could be is for '.', which is pretty much guaranteed to
|
||||||
// be a bonafide directory
|
// be a bonafide directory
|
||||||
return $realpath . '/' . $file;
|
if (!empty($file)) {
|
||||||
|
$realpath.= '/' . $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $realpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1136,7 +1140,11 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
return $this->chmod($mode, $path);
|
return $this->chmod($mode, $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// presumably $entries will never be empty because it'll always have . and ..
|
// normally $entries would have at least . and .. but it might not if the directories
|
||||||
|
// permissions didn't allow reading
|
||||||
|
if (empty($entries)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($entries as $filename=>$props) {
|
foreach ($entries as $filename=>$props) {
|
||||||
if ($filename == '.' || $filename == '..') {
|
if ($filename == '.' || $filename == '..') {
|
||||||
@ -1605,7 +1613,11 @@ class Net_SFTP extends Net_SSH2 {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$entries = $this->_list($path, true, false);
|
$entries = $this->_list($path, true, false);
|
||||||
|
|
||||||
// presumably $entries will never be empty because it'll always have . and ..
|
// normally $entries would have at least . and .. but it might not if the directories
|
||||||
|
// permissions didn't allow reading
|
||||||
|
if (empty($entries)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($entries as $filename=>$props) {
|
foreach ($entries as $filename=>$props) {
|
||||||
if ($filename == '.' || $filename == '..') {
|
if ($filename == '.' || $filename == '..') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user