|
From: <ki...@us...> - 2003-06-25 05:16:29
|
Update of /cvsroot/pymerase/pymerase/pymerase/output/dbAPI
In directory sc8-pr-cvs1:/tmp/cvs-serv4076
Modified Files:
dbAPI.py
Log Message:
Fix for bug #749872
Now escapes " properly
Now escaping '
field.value was not being processed by sqlEscapeString(), fixed.
Index: dbAPI.py
===================================================================
RCS file: /cvsroot/pymerase/pymerase/pymerase/output/dbAPI/dbAPI.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** dbAPI.py 9 May 2003 19:11:03 -0000 1.24
--- dbAPI.py 25 Jun 2003 05:16:26 -0000 1.25
***************
*** 59,63 ****
"""
if type(s) == types.StringType or type(s) == types.UnicodeType:
! return re.sub('"', '\"', s)
else:
return s
--- 59,65 ----
"""
if type(s) == types.StringType or type(s) == types.UnicodeType:
! s = re.sub('"', '\\\"', s)
! s = re.sub("'", "\\\'", s)
! return s
else:
return s
***************
*** 580,584 ****
update_names_list.append('"'+field.name+'"')
if field.type == types.StringType or field.type == types.UnicodeType:
! update_values_list.append("'%s'" % (field.value))
elif field.type == DateTime.DateTimeType:
update_values_list.append("'%s'" % (str(field.value)))
--- 582,586 ----
update_names_list.append('"'+field.name+'"')
if field.type == types.StringType or field.type == types.UnicodeType:
! update_values_list.append("'%s'" % (sqlEscapeString(field.value)))
elif field.type == DateTime.DateTimeType:
update_values_list.append("'%s'" % (str(field.value)))
|