From a9e20e78bca4eff80697e4ff6cf2060b3cc0e480 Mon Sep 17 00:00:00 2001 From: JangAyeon Date: Sun, 19 Jul 2026 14:35:56 +0900 Subject: [PATCH] [ZEPPELIN-6535] Match table column filter terms literally instead of as regex Typing a regular-expression metacharacter (e.g. `(`, `[`, `*`) into a Table visualization's per-column search box threw an uncaught SyntaxError and silently broke the column filter, because the term was compiled as a regular expression. In filterRows(), each column's predicate called String(row[key]).search(value.term), and String.prototype.search() coerces its argument to a RegExp, so the raw user-typed term became a pattern; benign metacharacters such as `[` or `*` also silently changed the match semantics instead of throwing. Match the term literally with String.prototype.includes() instead of compiling it via .search(). This is a no-op change in semantics for ordinary terms without metacharacters, so existing substring-filtering behavior is preserved. --- .../app/visualizations/table/table-visualization.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zeppelin-web-angular/src/app/visualizations/table/table-visualization.component.ts b/zeppelin-web-angular/src/app/visualizations/table/table-visualization.component.ts index 0eefb93ce73..e48092908cc 100644 --- a/zeppelin-web-angular/src/app/visualizations/table/table-visualization.component.ts +++ b/zeppelin-web-angular/src/app/visualizations/table/table-visualization.component.ts @@ -208,8 +208,9 @@ export class TableVisualizationComponent implements OnInit { sortKeys.push((row: any) => typeCoercion(row[key], value.type)); sortTypes.push(value.sort); } + const term = value.term.trim(); // eslint-disable-next-line @typescript-eslint/no-explicit-any - terms.push((row: any) => String(row[key]).search(value.term) !== -1); + terms.push((row: any) => String(row[key]).includes(term)); }); this.rows = filter(this.tableData.rows, row => terms.every(term => term(row))); this.rows = orderBy(this.rows, sortKeys, sortTypes);