Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression Engine: Replace == by = #1

Open
NITFALL opened this issue Jul 8, 2024 · 0 comments
Open

Expression Engine: Replace == by = #1

NITFALL opened this issue Jul 8, 2024 · 0 comments

Comments

@NITFALL
Copy link

NITFALL commented Jul 8, 2024

In the ExpressionEngine in line 728 there is a piece of code which tries to replace "==" by "=".

myStr = myStr.replace(new RegExp('=='), '=');

This only replaces the first occurrence of all available "==".
So a more complex expression like
(a > 3 && b == 'abc') || (partNumber == 'xyz' || (properties.cellType == 'Battery' && (dut.id <= 1 || dut.p == 3)))

fails to evaluate because only b == 'abc' will be replaced by b = 'abc'.

If I change the code to
myStr = myStr.replace(new RegExp('==', 'g'), '=');
all occurrences get replaced and evaluation of the given expression passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant