Fix RegexPathElement when matching variables against a root path

The first fix for issue 15264 covered the case of using a single
variable (the case mentioned in the bug report). However, when
more than one variable is used a different PathElement is built.
This RegexPathElement needs a similar change that checks the
path includes data to bind.

Issue: SPR-15264
This commit is contained in:
Andy Clement
2017-02-19 17:06:49 -08:00
parent 9829a62044
commit d924538211
2 changed files with 32 additions and 1 deletions

View File

@@ -125,7 +125,9 @@ class RegexPathElement extends PathElement {
if (matches) {
if (next == null) {
// No more pattern, is there more data?
matches = (p == matchingContext.candidateLength);
// If pattern is capturing variables there must be some actual data to bind to them
matches = (p == matchingContext.candidateLength &&
((this.variableNames.size() == 0) ? true : p > candidateIndex));
}
else {
if (matchingContext.isMatchStartMatching && p == matchingContext.candidateLength) {