-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WW-5340 Mild refactor StrutsOgnlGuard for easier subclassing #760
Conversation
values.add(StringUtils.EMPTY); | ||
} else if (size > maxStringLength) { | ||
if (size > maxStringLength) { | ||
LOG.debug("Form field {} of size {} bytes exceeds limit of {}.", item.getFieldName(), size, maxStringLength); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added this line, no other functional changes here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think logging the field name at the debug level is fine in terms of security?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume so, yet this is a user controlled value so maybe it needs escaping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure a field name can even contain newline characters but anyway SonarCloud is happy now
return false; | ||
} | ||
|
||
protected boolean checkNode(Node node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I separated the recursion logic from the node checking logic so that subclasses don't need to unnecessarily duplicate that code when overriding.
Kudos, SonarCloud Quality Gate passed! |
WW-5340
Quick follow-up to #747
See comments