kusalk commented on code in PR #1072:
URL: https://github.com/apache/struts/pull/1072#discussion_r1797691170
##########
core/src/main/java/org/apache/struts2/interceptor/parameter/ParametersInterceptor.java:
##########
@@ -348,7 +349,15 @@ protected boolean isParameterAnnotatedAndAllowlist(String
name, Object action) {
}
long paramDepth = name.codePoints().mapToObj(c -> (char)
c).filter(NESTING_CHARS::contains).count();
+
+ if (action instanceof ModelDriven<?> &&
!ActionContext.getContext().getValueStack().peek().equals(action)) {
+ LOG.debug("Model driven Action detected, exempting from
@StrutsParameter annotation requirement and OGNL allowlisting model type");
+ // (Exempted by annotation on
com.opensymphony.xwork2.ModelDriven#getModel)
+ return hasValidAnnotatedMember("model", action, paramDepth + 1);
Review Comment:
This conditional block and the added annotation on the `ModelDriven`
interface comprise the core fix
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]