소스 검색

wxGUI: escape single quotes when editing attributes from GUI, see https://trac.osgeo.org/grass/ticket/2252

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69153 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 년 전
부모
커밋
5ffe36bebf
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      gui/wxpython/dbmgr/base.py
  2. 2 1
      gui/wxpython/dbmgr/dialogs.py

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

@@ -1620,7 +1620,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]
 

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

@@ -20,6 +20,7 @@ This program is free software under the GNU General Public License
 import os
 import types
 
+import grass.script as gscript
 from core import globalvar
 from core.utils import _
 import wx
@@ -252,7 +253,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: