Skip to content

Commit 8e3615e

Browse files
fix: table columns with names of ' or "" or `` could not be dropped (#18506)
* fix: table columns with names of ' or "" or `` could not be dropped Unsafe javascript string was passed to the currColumnName var. By using escapeJsString from /modules/functions/escape.ts the unsafe string becomes a safe string and the rest of the code runs as expected. fixes issue #18448 Signed-off-by: Thanasis Mpalatsoukas <thanasismpalatsoukas@gmail.com> * fix: added an extra space below and added a signoff additionally Signed-off-by: Thanasis Mpalatsoukas <thanasismpalatsoukas@gmail.com> --------- Signed-off-by: Thanasis Mpalatsoukas <thanasismpalatsoukas@gmail.com>
1 parent 170cc40 commit 8e3615e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

js/src/table/structure.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import highlightSql from '../modules/sql-highlight.ts';
77
import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
88
import { Indexes } from '../modules/indexes.ts';
99
import getJsConfirmCommonParam from '../modules/functions/getJsConfirmCommonParam.ts';
10-
import { escapeHtml } from '../modules/functions/escape.ts';
10+
import { escapeHtml, escapeJsString } from '../modules/functions/escape.ts';
1111
import refreshMainContent from '../modules/functions/refreshMainContent.ts';
1212

1313
/**
@@ -191,7 +191,8 @@ AJAX.registerOnload('table/structure.js', function () {
191191
* @var currColumnName String containing name of the field referred to by {@link curr_row}
192192
*/
193193
var currColumnName = $currRow.children('th').children('label').text().trim();
194-
currColumnName = escapeHtml(currColumnName);
194+
currColumnName = escapeJsString(escapeHtml(currColumnName));
195+
195196
/**
196197
* @var $afterFieldItem Corresponding entry in the 'After' field.
197198
*/

0 commit comments

Comments
 (0)