Skip to main content
Level 2
2月 19, 2019 12:50 下午 UTC
已解决

RTE Plugin modifying HTML || Removing JS functions like onClick=""

RTE plugin is modifying my html content while using source edit option.

How to work around this ?

Is there any option to avoid this?

Thanks!

此主题已关闭回复。
Gaurav-Behl
Level 10
2月 21, 2019 3:44 下午 UTC

You'd need to overlay either or both based on how you've coded-

  1. /libs/cq/xssprotection/config.xml
  2. /libs/sling/xss/config.xml

Refer Re: links to ppt not working on OOB text component  for detailed configurations. Allow those specific characters that are printed in the logs -

(

,

'

)

5回复

smacdonald2008
Level 10
2月 19, 2019 2:18 下午 UTC

How is your HTML being modified? Can you please provide more details. Are you using AEM 6.4 and Touch UI?

翻译
Gaurav-Behl
Level 10
2月 19, 2019 5:20 下午 UTC

check if you can find any AntiSamy or other related errors in error.log for this component/page?

翻译
Level 2
2月 21, 2019 5:54 上午 UTC

Yes I am getting AntiSamy in logs

**** GET / org.apache.sling.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The a tag contained an attribute that we could not process. The onclick attribute had a value of "openTab(event, 'All')". This value could not be accepted for security reasons. We have chosen to remove this attribute from the tag and leave everything else in place so that we could process the input.*****

翻译
Gaurav-Behl
Level 10
2月 21, 2019 3:44 下午 UTC

You'd need to overlay either or both based on how you've coded-

  1. /libs/cq/xssprotection/config.xml
  2. /libs/sling/xss/config.xml

Refer Re: links to ppt not working on OOB text component  for detailed configurations. Allow those specific characters that are printed in the logs -

(

,

'

)

翻译
Level 2
2月 22, 2019 10:27 上午 UTC

Thanks a ton! Reference link was very helpful.

翻译