From: Vincent Vanwaelscappel Date: Wed, 24 Jan 2024 08:00:32 +0000 (+0100) Subject: wip #6652 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=88bd8df813263e6dc58c694c3366c755f2aabccb;p=cubist_util.git wip #6652 @1 --- diff --git a/src/CommandLine/LFTP.php b/src/CommandLine/LFTP.php index 9fbdca2..8a01a86 100644 --- a/src/CommandLine/LFTP.php +++ b/src/CommandLine/LFTP.php @@ -56,7 +56,12 @@ class LFTP extends CloneUserpassProgram } $commands[] = $mirrorCmd; - $this->setArg('c', 'open ftp://'.$this->getUsername().':'.$this->getPassword().'@'.$this->getHost().':'.$this->getPort().' '.implode(';', $commands)); + $this->setArg('c', 'open ftp://' . $this->getUsername() . ':' . $this->getEscapedPassword() . '@' . $this->getHost() . ':' . $this->getPort() . ' ' . implode(';', $commands)); + } + + protected function getEscapedPassword() + { + return addcslashes($this->getPassword(), '&'); } /**