From 7f2be0d6b615e48b34cc6e383350e5654d6c58da Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Sat, 16 Jul 2016 14:24:26 +0100 Subject: [PATCH] #86: Url encode db password --- database/migrations/2016_07_14_154357_MysqlToPostgres.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2016_07_14_154357_MysqlToPostgres.php b/database/migrations/2016_07_14_154357_MysqlToPostgres.php index c25fd5f3..ba4679be 100644 --- a/database/migrations/2016_07_14_154357_MysqlToPostgres.php +++ b/database/migrations/2016_07_14_154357_MysqlToPostgres.php @@ -18,8 +18,8 @@ class MysqlToPostgres extends Migration $this->console = new ConsoleOutput(); // Generate pgloader config - $mysqlConnection = "from mysql://" . env('DB_USERNAME') . ":" . env('DB_PASSWORD') . "@" . env('DB_HOST') . "/" . env('DB_DATABASE'); - $postgresConnection = "into postgresql://" . env('POSTGRESQL_DB_USERNAME', 'homestead') . ":" . env('POSTGRESQL_DB_PASSWORD', 'secret') . "@" . env('POSTGRESQL_DB_HOST', 'localhost') . "/" . env('POSTGRESQL_DB_DATABASE', 'homestead'); + $mysqlConnection = "from mysql://" . env('DB_USERNAME') . ":" . urlencode(env('DB_PASSWORD')) . "@" . env('DB_HOST') . "/" . env('DB_DATABASE'); + $postgresConnection = "into postgresql://" . env('POSTGRESQL_DB_USERNAME', 'homestead') . ":" . urlencode(env('POSTGRESQL_DB_PASSWORD', 'secret')) . "@" . env('POSTGRESQL_DB_HOST', 'localhost') . "/" . env('POSTGRESQL_DB_DATABASE', 'homestead'); $header = "LOAD DATABASE"; $body = <<<'EOD'