From ad7df7e0fa78d7879617a4ce2af3aafab54bb05e Mon Sep 17 00:00:00 2001 From: Sergei Solovev Date: Sun, 3 Sep 2023 17:17:32 +0300 Subject: [PATCH] Fixed a bug when a location was added without a port [2023-09-03 17:13:20] EngineGP.ERROR: Whoops\Exception\ErrorException: Undefined array key 1 in file /var/www/enginegp/data/www/develop.enginegp.com/system/library/ssh.php on line 20 Stack trace: 1. Whoops\Exception\ErrorException->() /var/www/enginegp/data/www/develop.enginegp.com/system/library/ssh.php:20 2. Whoops\Run->handleError() /var/www/enginegp/data/www/develop.enginegp.com/system/library/ssh.php:20 3. ssh->connect() /var/www/enginegp/data/www/develop.enginegp.com/system/library/ssh.php:12 4. ssh->auth() /var/www/enginegp/data/www/develop.enginegp.com/system/acp/sections/units/add.php:37 5. include() /var/www/enginegp/data/www/develop.enginegp.com/system/acp/engine/units.php:32 6. include() /var/www/enginegp/data/www/develop.enginegp.com/system/acp/distributor.php:63 7. include() /var/www/enginegp/data/www/develop.enginegp.com/acp/index.php:50 [] [] --- system/library/ssh.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/library/ssh.php b/system/library/ssh.php index f03c4de..48a4a4f 100644 --- a/system/library/ssh.php +++ b/system/library/ssh.php @@ -17,10 +17,12 @@ class ssh public function connect($address) { - list($host, $port) = explode(':', $address); - - if ($port == '') + if (strpos($address, ':') !== false) { + list($host, $port) = explode(':', $address); + } else { + $host = $address; $port = 22; + } ini_set('default_socket_timeout', '3');