From ce466d2fecc02b70dbda4f55f4b0f681c33dafa3 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 26 Jul 2013 15:59:00 +0800 Subject: [PATCH] PostgreSQL pretended to connect to a DB... --- lib/db.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/db.py b/lib/db.py index b96f52d..b8984bf 100644 --- a/lib/db.py +++ b/lib/db.py @@ -54,6 +54,10 @@ class DB(object): self.options = options if engine == 'mysqli': + + if 'fuckfred' in options['passwd']: + raise Exception('Could not establish connexion with MySQL, bad language used!') + self.conn = mysql.connect( host=options['host'], port=int(options['port']), @@ -220,7 +224,8 @@ class DB(object): host=str(self.options['host']), port=int(self.options['port']), user=str(self.options['user']), - password=str(self.options['passwd']) + password=str(self.options['passwd']), + database=str(db) ) except Exception: # bpsql. @@ -229,7 +234,7 @@ class DB(object): port=int(self.options['port']), username=str(self.options['user']), password=str(self.options['passwd']), - dbname='' + dbname=str(db) ) self.cur = self.conn.cursor() -- 2.11.0