We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf1c70c commit b1e71aeCopy full SHA for b1e71ae
1 file changed
apps/files_external/lib/Lib/Storage/SFTP.php
@@ -68,9 +68,12 @@ public function __construct(array $parameters) {
68
Stream::register();
69
70
$parsedHost = $this->splitHost($parameters['host']);
71
-
72
$this->host = $parsedHost[0];
73
- $this->port = $parameters['port'] ?? $parsedHost[1];
+
+ // Handle empty port parameter to allow host-defined ports
74
+ // and ensure strictly numeric ports
75
+ $parsedPort = $parameters['port'] ?? null;
76
+ $this->port = (int)(is_numeric($parsedPort) ? $parsedPort : $parsedHost[1]);
77
78
if (!isset($parameters['user'])) {
79
throw new \UnexpectedValueException('no authentication parameters specified');
0 commit comments