Repository navigation
[6.x] Match contains_any values literally in field conditions - #15531
Merged
jasonvarga merged 1 commit intoSep 29, 2026
Merged
jasonvarga merged 1 commit into
jasonvarga merged 1 commit into
Conversation
contains_any values literally in field conditionscontains_any values literally in field conditions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15530
contains_anybuilt a regular expression from its values without escaping them, soa.bmatchedaxb,(555)matched any value containing555,$100never matched, andC++threwSyntaxError: Invalid regular expression.This matches each value as a literal substring instead, which keeps the operator's substring semantics (
contains_any foostill matchesfoobar) without reading any value as a pattern. Anullorundefinedfield value is now treated as an empty string. Before,RegExp.prototype.testcoerced it to the text"null"or"undefined", socontains_any ulmatched an empty field. The array branch is unchanged: it already compares values exactly throughintersection.includes_anyis not touched; #13135 already gave it exact matching.Tests
Adds
it matches contains_any values literally rather than as patternstoresources/js/tests/FieldConditionsValidator.test.js, covering.,(…),+and$. It fails on6.xwithout the change (axbmatchesa.b) and passes with it; the file's other 52 tests still pass, andnpx vitest run --project unitpasses (628 tests).