fix validation for query references with empty parameter values
This commit is contained in:
parent
3eda8580fc
commit
bae27ef706
|
@ -1065,7 +1065,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
|
||||||
if (!context.getResourceNames().contains(tn)) {
|
if (!context.getResourceNames().contains(tn)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} 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]*=[^=&]*))*");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3276,7 +3276,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
|
|
||||||
if (conditional) {
|
if (conditional) {
|
||||||
String query = ref.substring(ref.indexOf("?"));
|
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-]*)?)*)?$"),
|
//("^\\?([\\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;
|
ok = rule(errors, "2023-02-20", IssueType.INVALID, element.line(), element.col(), path, test, I18nConstants.REFERENCE_REF_QUERY_INVALID, ref) && ok;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue