Prechádzať zdrojové kódy

wxGUI: escape single quotes when editing attributes from GUI, see https://trac.osgeo.org/grass/ticket/2252 (merge from trunk, https://trac.osgeo.org/grass/changeset/69153, https://trac.osgeo.org/grass/changeset/69173)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@69175 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 rokov pred
rodič
commit
0adce8afff

+ 1 - 1
gui/wxpython/dbmgr/base.py

@@ -1480,7 +1480,7 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
                     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]
                 

+ 1 - 1
gui/wxpython/dbmgr/dialogs.py

@@ -242,7 +242,7 @@ class DisplayAttributesDialog(wx.Dialog):
                             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: