ソースを参照

Merge pull request #6640 from wenzhixin/fix/6594

Escape apostrophe manually
文翼 2 年 前
コミット
c435ccfb68
1 ファイル変更6 行追加1 行削除
  1. 6 1
      src/utils/index.js

+ 6 - 1
src/utils/index.js

@@ -407,6 +407,11 @@ export default {
     return false
   },
 
+  escapeApostrophe (value) {
+    return value.toString()
+      .replace(/'/g, ''')
+  },
+
   escapeHTML (text) {
     if (!text) {
       return text
@@ -524,7 +529,7 @@ export default {
 
         const field = columns[x].field
 
-        row[field] = $el.html().trim()
+        row[field] = this.escapeApostrophe($el.html().trim())
         // save td's id, class and data-* attributes
         row[`_${field}_id`] = $el.attr('id')
         row[`_${field}_class`] = $el.attr('class')