From c2a6c673fb90643ad99208979d0295095cba39c5 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Mon, 13 Jul 2015 18:32:41 +0200 Subject: [PATCH] Bug #3745: encode password to allow all chars --- src/onedb/onedb_backend.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/onedb/onedb_backend.rb b/src/onedb/onedb_backend.rb index 1135dfb956..a4a5169f62 100644 --- a/src/onedb/onedb_backend.rb +++ b/src/onedb/onedb_backend.rb @@ -16,6 +16,7 @@ require 'time' require 'rubygems' +require 'cgi' begin require 'sequel' @@ -284,7 +285,9 @@ class BackEndMySQL < OneDBBacKEnd private def connect_db - endpoint = "mysql://#{@user}:#{@passwd}@#{@server}:#{@port}/#{@db_name}" + passwd = CGI.escape(@passwd) + + endpoint = "mysql://#{@user}:#{passwd}@#{@server}:#{@port}/#{@db_name}" begin @db = Sequel.connect(endpoint) @@ -337,4 +340,4 @@ class BackEndSQLite < OneDBBacKEnd raise "Error connecting to DB: " + e.message end end -end \ No newline at end of file +end