From 26d002a51a0a233ef6cf7be9e50e7efc5235cd5b Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 25 May 2023 20:22:42 +0700 Subject: [PATCH] [ticket/17139] Fix more PHP fatal errors PHPBB3-17139 --- phpBB/includes/functions_transfer.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 763b6c70db..b240347c86 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -832,6 +832,11 @@ class ftp_fsock extends transfer */ function _send_command($command, $args = '', $check = true) { + if (!$this->connection) + { + return false; + } + if (!empty($args)) { $command = "$command $args"; @@ -921,6 +926,11 @@ class ftp_fsock extends transfer */ function _close_data_connection() { + if (!$this->connection) + { + return false; + } + return @fclose($this->data_connection); } @@ -930,6 +940,11 @@ class ftp_fsock extends transfer */ function _check_command($return = false) { + if (!$this->connection) + { + return false; + } + $response = ''; do