[GRASS-SVN] r69175 - grass/branches/releasebranch_7_0/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 21 06:06:59 PDT 2016


Author: annakrat
Date: 2016-08-21 06:06:59 -0700 (Sun, 21 Aug 2016)
New Revision: 69175

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py
   grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py
Log:
wxGUI: escape single quotes when editing attributes from GUI, see #2252 (merge from trunk, r69153, r69173)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py	2016-08-21 13:04:37 UTC (rev 69174)
+++ grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/base.py	2016-08-21 13:06:59 UTC (rev 69175)
@@ -1480,7 +1480,7 @@
                     columnsString += '%s,' % columnName[i]
                     
                     if tlist.columns[columnName[i]]['ctype'] == str:
-                        valuesString += "'%s'," % values[i]
+                        valuesString += "'%s'," % values[i].replace("'", "''")
                     else:
                         valuesString += "%s," % values[i]
                 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py	2016-08-21 13:04:37 UTC (rev 69174)
+++ grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py	2016-08-21 13:06:59 UTC (rev 69175)
@@ -242,7 +242,7 @@
                             if ctype != str:
                                 updatedValues.append(str(newvalue))
                             else:
-                                updatedValues.append("'" + newvalue + "'")
+                                updatedValues.append("'" + newvalue.replace("'", "''") + "'")
                         columns[name]['values'][idx] = newvalue
 
                 if self.action != "add" and len(updatedValues) == 0:



More information about the grass-commit mailing list