]> _ Git - cubist_util.git/commitdiff
wip #6652 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 Jan 2024 08:00:32 +0000 (09:00 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 Jan 2024 08:00:32 +0000 (09:00 +0100)
src/CommandLine/LFTP.php

index 9fbdca2682fbc79904faff01895f8b105f4e51ce..8a01a86281c47db86062eafdb0b13242fb8c7c08 100644 (file)
@@ -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(), '&');
     }
 
     /**