fix validation for query references with empty parameter values

This commit is contained in:
Grahame Grieve 2023-02-21 16:46:27 +11:00
parent 3eda8580fc
commit bae27ef706
2 changed files with 2 additions and 2 deletions

View File

@ -1065,7 +1065,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
if (!context.getResourceNames().contains(tn)) {
return false;
} else {
return q.matches("([_a-zA-Z][_a-zA-Z0-9]*=[^=&]+)(&([_a-zA-Z][_a-zA-Z0-9]*=[^=&]+))*");
return q.matches("([_a-zA-Z][_a-zA-Z0-9]*=[^=&]*)(&([_a-zA-Z][_a-zA-Z0-9]*=[^=&]*))*");
}
}

View File

@ -3276,7 +3276,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (conditional) {
String query = ref.substring(ref.indexOf("?"));
boolean test = !Utilities.noString(query) && query.matches("\\?([_a-zA-Z][_a-zA-Z0-9]*=[^=&]+)(&([_a-zA-Z][_a-zA-Z0-9]*=[^=&]+))*");
boolean test = !Utilities.noString(query) && query.matches("\\?([_a-zA-Z][_a-zA-Z0-9]*=[^=&]*)(&([_a-zA-Z][_a-zA-Z0-9]*=[^=&]*))*");
//("^\\?([\\w-]+(=[\\w-]*)?(&[\\w-]+(=[\\w-]*)?)*)?$"),
ok = rule(errors, "2023-02-20", IssueType.INVALID, element.line(), element.col(), path, test, I18nConstants.REFERENCE_REF_QUERY_INVALID, ref) && ok;