Etemplate: Avoid trying to process regexes by checking for end anchor

This commit is contained in:
nathangray 2020-07-10 13:27:48 -06:00
parent 13842ffb79
commit af4fcd7a2d
2 changed files with 7 additions and 2 deletions

View File

@ -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] || {};

View File

@ -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] || {};