From 8a7bd3c38bcba0e501e81be360023a2c7fa04901 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 7 Aug 2012 14:04:19 -0500 Subject: [PATCH] fixed issue 488, important security issues, monkeypatch pymysql, thanks Roman --- VERSION | 2 +- gluon/dal.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3f52ac61..ffa64e0a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-07 12:26:30) dev +Version 2.00.0 (2012-08-07 14:04:15) dev diff --git a/gluon/dal.py b/gluon/dal.py index 0d168286..63e611e5 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -253,6 +253,11 @@ if not 'google' in drivers: # first try contrib driver, then from site-packages (if installed) try: import contrib.pymysql as pymysql + # monkeypatch pymysql because they havent fixed the bug: + # https://github.com/petehunt/PyMySQL/issues/86 + pymysql.ESCAPE_REGEX = re.compile("'") + pymysql.ESCAPE_MAP = {"'": "''"} + # end monkeypatch except ImportError: import pymysql drivers.append('pymysql')