From 11027e25a25d5b0fca6fc9969f5cf93c06785c43 Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sun, 21 Nov 2021 11:58:59 +0100 Subject: [PATCH] Invoke missing path escaping for FTP paths. --- src/Adapter/Ftp.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Adapter/Ftp.php b/src/Adapter/Ftp.php index 869437699..22065b842 100644 --- a/src/Adapter/Ftp.php +++ b/src/Adapter/Ftp.php @@ -563,11 +563,10 @@ protected function ftpRawlist($options, $path) $connection = $this->getConnection(); if ($this->isPureFtpd) { - $path = str_replace(' ', '\ ', $path); - $this->escapePath($path); + $path = str_replace([' ', '[', ']'], ['\ ', '\\[', '\\]'], $path); } - return ftp_rawlist($connection, $options . ' ' . $path); + return ftp_rawlist($connection, $options . ' ' . $this->escapePath($path)); } private function getRawExecResponseCode($command)