[
https://issues.apache.org/jira/browse/WW-5022?focusedWorklogId=703899&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-703899
]
ASF GitHub Bot logged work on WW-5022:
--------------------------------------
Author: ASF GitHub Bot
Created on: 05/Jan/22 12:16
Start Date: 05/Jan/22 12:16
Worklog Time Spent: 10m
Work Description: gregh3269 commented on pull request #523:
URL: https://github.com/apache/struts/pull/523#issuecomment-1005635772
For the java templates plugin to work, possibly need to add the
escapeHtmlBody parameter to the evaluateExtraParams() of the anchor and submit
tag, otherwise its not passed to the plugin.
org.apache.struts2.components.Anchor
@Override
protected void evaluateExtraParams() {
super.evaluateExtraParams();
if (href != null) {
addParameter("href",
ensureAttributeSafelyNotEscaped(findString(href)));
} else {
//no href, build it from URL attributes
StringWriter sw = new StringWriter();
urlRenderer.beforeRenderUrl(urlProvider);
urlRenderer.renderUrl(sw, urlProvider);
String builtHref = sw.toString();
if (StringUtils.isNotEmpty(builtHref)) {
addParameter("href",
ensureAttributeSafelyNotEscaped(builtHref));
}
}
**addParameter("escapeHtmlBody", escapeHtmlBody)**;
}
Maybe there is an alternative way, as escapeHtmlBody are not part of UIBean.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 703899)
Time Spent: 40m (was: 0.5h)
> Struts 2.6 escaping behaviour change for s:a (anchor) tag
> ---------------------------------------------------------
>
> Key: WW-5022
> URL: https://issues.apache.org/jira/browse/WW-5022
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.6
> Environment: Tomcat 7.0, 8.5 using Java 8 and 11.
> Reporter: James Chaplin
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 2.6
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> While interacting with the current 2.6 Showcase application I recently
> noticed that+ the "Home" glyph icon was not displaying correctly+. Instead
> of the icon, +the page displayed the body content literally in the browser+.
> Checking the page source (view source in browser) it turns out the body
> content of the tag was HTML-escaped. I double-checked and this does not
> happen to Struts 2.5.21 (snapshot) or older 2.6 Showcase apps.
> This behaviour might affect other tags, but +it was noticed and confirmed
> with "s:a"+ (the JSP anchor tag).
> After some digging (using older commits from GitHub and building the 2.6
> Showcase app from them) it appears the automatic body escaping did not occur
> prior to January 2nd 2019, but was introduced with one of the multiple
> commits applied on January 3rd 2019.
> It could be an interaction between earlier mid-December 2018 commits that
> changed the Freemarker configuration version in FreemarkerManager
> (Configuration.VERSION_2_3_0) to a new one (Configuration.VERSION_2_3_28),
> combined with the January 3rd commits. Couldn't find the exact cause, but
> perhaps one of the Struts Team might be able to do so.
> Given the original/old behaviour +it seems that auto-escaping the tag body
> might be a bug+.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)