mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
Fixed error-checking error in sftp.php
This commit is contained in:
parent
68f278025c
commit
3e2d4c1bc1
1 changed files with 8 additions and 6 deletions
|
|
@ -94,15 +94,17 @@ class SFTP extends \OC\Files\Storage\Common {
|
|||
private function writeHostKeys($keys) {
|
||||
try {
|
||||
$keyPath = $this->hostKeysPath();
|
||||
$fp = fopen($keyPath, 'w');
|
||||
foreach ($keys as $host => $key) {
|
||||
fwrite($fp, $host . '::' . $key . "\n");
|
||||
if ($keyPath && file_exists($keyPath)) {
|
||||
$fp = fopen($keyPath, 'w');
|
||||
foreach ($keys as $host => $key) {
|
||||
fwrite($fp, $host . '::' . $key . "\n");
|
||||
}
|
||||
fclose($fp);
|
||||
return true;
|
||||
}
|
||||
fclose($fp);
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function readHostKeys() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue