From af4fcd7a2ddb21d6e642272d6b9ccfe7b9c012bd Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 10 Jul 2020 13:27:48 -0600 Subject: [PATCH] Etemplate: Avoid trying to process regexes by checking for end anchor --- api/js/etemplate/et2_core_arrayMgr.js | 4 +++- api/js/etemplate/et2_core_arrayMgr.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_core_arrayMgr.js b/api/js/etemplate/et2_core_arrayMgr.js index 8a5d12f269..dedbc886cc 100644 --- a/api/js/etemplate/et2_core_arrayMgr.js +++ b/api/js/etemplate/et2_core_arrayMgr.js @@ -207,7 +207,9 @@ var et2_arrayMgr = /** @class */ (function () { var is_index_in_content = _ident.charAt(0) == '@'; // Check whether "$" occurs in the given identifier var pos_var = _ident.indexOf('$'); - if (pos_var >= 0 && (this.perspectiveData.row != null || !_ident.match(/\$\{?row\}?/))) { + if (pos_var >= 0 && (this.perspectiveData.row != null || !_ident.match(/\$\{?row\}?/)) + // Avoid messing with regex in validators + && pos_var !== _ident.indexOf("$/")) { // Get the content array for the current row var row = typeof this.perspectiveData.row == 'number' ? this.perspectiveData.row : ''; var row_cont = this.data[row] || {}; diff --git a/api/js/etemplate/et2_core_arrayMgr.ts b/api/js/etemplate/et2_core_arrayMgr.ts index 97afdf6946..d494e2ed03 100644 --- a/api/js/etemplate/et2_core_arrayMgr.ts +++ b/api/js/etemplate/et2_core_arrayMgr.ts @@ -225,7 +225,10 @@ export class et2_arrayMgr // Check whether "$" occurs in the given identifier const pos_var = _ident.indexOf('$'); - if (pos_var >= 0 && (this.perspectiveData.row != null || !_ident.match(/\$\{?row\}?/))) { + if (pos_var >= 0 && (this.perspectiveData.row != null || !_ident.match(/\$\{?row\}?/)) + // Avoid messing with regex in validators + && pos_var !== _ident.indexOf("$/") + ) { // Get the content array for the current row const row = typeof this.perspectiveData.row == 'number' ? this.perspectiveData.row : ''; const row_cont = this.data[row] || {};