From 5d7188d46e7824b29bd8a877839cf4f9b46bbb23 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 7 May 2012 20:54:20 +0200 Subject: [PATCH] Changed from manual escaping to escapeshellarg in SshConnector --- frontend/classes/class.sshconnector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/classes/class.sshconnector.php b/frontend/classes/class.sshconnector.php index d37fb38..a8e8267 100644 --- a/frontend/classes/class.sshconnector.php +++ b/frontend/classes/class.sshconnector.php @@ -101,8 +101,8 @@ class SshConnector extends CPHPBaseClass private function DoCommand($command, $throw_exception) { - $command = str_replace("'", "\'", $command); - $command = "{$this->helper} '{$command}'"; + $command = escapeshellarg($command); + $command = "{$this->helper} {$command}"; $stream = ssh2_exec($this->connection, $command); stream_set_blocking($stream, true);