From 440b3c78f2f4a623920beb26ed8093b4dd9fe586 Mon Sep 17 00:00:00 2001 From: Tim Spratt Date: Tue, 23 Nov 2021 21:01:47 +0000 Subject: [PATCH] uppercase port option for scp --- src/Ssh.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Ssh.php b/src/Ssh.php index c822199..41952b2 100755 --- a/src/Ssh.php +++ b/src/Ssh.php @@ -197,11 +197,15 @@ public function upload(string $sourcePath, string $destinationPath): Process protected function getExtraScpOptions(): string { - $extraOptions = $this->getExtraOptions(); + $extraOptions = $this->extraOptions; + + if (isset($extraOptions['port'])) { + $extraOptions['port'] = str_replace('-p', '-P', $extraOptions['port']); + } $extraOptions[] = '-r'; - return implode(' ', $extraOptions); + return implode(' ', array_values($extraOptions)); } private function getExtraOptions(): array