[
https://issues.apache.org/jira/browse/SLING-7658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16498315#comment-16498315
]
Konrad Windszus commented on SLING-7658:
----------------------------------------
[~igurjar] Thanks for following up on this. Actually I have an issue with the
HTL engine which is internally using {{XSSApi.encodeForHtml}} for the Display
Context {{text}}
(https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/f46ff4d97b96d21da521651fe9f789f89253452f/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/XSSRuntimeExtension.java#L99).
But maybe just using {{html}} is enough here, as that internally relies on the
mentioned XSSFilter. It seems though that by default for all content within
almost every html tag the context {{text}} is choosen by default, so I need to
overwrite that, to achieve my goal. I will let you know whether that works.
> XSSApi.encodeForHtml doesn't leave unicode character escapes untouched
> ----------------------------------------------------------------------
>
> Key: SLING-7658
> URL: https://issues.apache.org/jira/browse/SLING-7658
> Project: Sling
> Issue Type: Bug
> Components: XSS Protection API
> Affects Versions: XSS Protection API 2.1.0
> Reporter: Konrad Windszus
> Priority: Major
> Attachments: SLING-7658-v01.patch
>
>
> Whenever {{encodeForHtml}} is called with a string containing a unicode
> character escapes
> (https://www.w3.org/International/questions/qa-escapes#answer), the {{&}}
> gets escaped again. I.e. {{✅}} becomes {{✅}}.
> Compare with the discussion at
> https://www.mail-archive.com/[email protected]/msg76863.html.
> Attached is a patch with a failing test.
> Another use case for using unicode character escapes is the soft hyphen
> (https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens#Suggesting_line_break_opportunities).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)