diff --git a/src/BackupHandlers/Database/Databases/MySQLDatabase.php b/src/BackupHandlers/Database/Databases/MySQLDatabase.php index 893ba119..9c08edfb 100644 --- a/src/BackupHandlers/Database/Databases/MySQLDatabase.php +++ b/src/BackupHandlers/Database/Databases/MySQLDatabase.php @@ -59,7 +59,7 @@ public function dump($destinationFile) escapeshellarg($temporaryCredentialsFile), escapeshellarg($this->database), escapeshellarg($destinationFile), - escapeshellarg($this->getSocketArgument()) + escapeshellcmd($this->getSocketArgument()) ); return $this->console->run($command); diff --git a/tests/database/MySQLDatabaseTest.php b/tests/database/MySQLDatabaseTest.php index 60b4bffb..7426205c 100644 --- a/tests/database/MySQLDatabaseTest.php +++ b/tests/database/MySQLDatabaseTest.php @@ -52,7 +52,7 @@ public function testCustomSocket() $this->console, 'testDatabase', 'testUser', 'password', 'localhost', '3306', 'customSocket.sock' ); $this->console->shouldReceive('run') - ->with("/mysqldump --defaults-extra-file='(.*)' --skip-comments --skip-extended-insert 'testDatabase' > 'testfile.sql' '--socket=customSocket.sock'/") + ->with("/mysqldump --defaults-extra-file='(.*)' --skip-comments --skip-extended-insert 'testDatabase' > 'testfile.sql' --socket=customSocket.sock/") ->once() ->andReturn(true);