Expand my Community achievements bar.

SOLVED

Issue in adding x-cq-linkchecker attribute to anchor tag

Avatar

Level 2

Hi all,

 

I have a requirement to add x-cq-linkchecker attribute to an anchor tag conditionally (basically on the basis of the option selected by author in dialog). I am aware that to add this attribute in /apps/cq/xssprotection/config.xml. Following is the xml entry in anchor tag:
<attribute name="x-cq-linkchecker">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>

The issue is that despite adding it to the config file in /apps/cq/xssprotection, I am still not able to use it in the anchor tag. Following is an example of how I have added it to the anchor tag:
<a
x-cq-linkchecker="${button.skipLinkChecker ? 'skip' : ''}"> Test anchor link </a>

This is what I see on page:
<a>Test anchor link</a>

Note: I have checked that ${button.skipLinkChecker} contains a value and that there is no issue in this condition.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

@99spanchal 

You can check the below points, if this issue is not resolved yet.

1. any other config file in project which is taking precedence of the /apps/cq/xssprotection/config.xml - verify in the HTML source of the page or in the Apache Sling XSS protection config - policy path value

2. If there is a SP upgrade done recently, do check if the latest config file is overlaid to /apps

3. try this <a ${button.skipLinkChecker ? 'x-cq-linkchecker' : ''}="anything">Test anchor link</a>
4. As mentioned in this thread, you should restart AEM instance for the new config to apply.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

@99spanchal 

You can check the below points, if this issue is not resolved yet.

1. any other config file in project which is taking precedence of the /apps/cq/xssprotection/config.xml - verify in the HTML source of the page or in the Apache Sling XSS protection config - policy path value

2. If there is a SP upgrade done recently, do check if the latest config file is overlaid to /apps

3. try this <a ${button.skipLinkChecker ? 'x-cq-linkchecker' : ''}="anything">Test anchor link</a>
4. As mentioned in this thread, you should restart AEM instance for the new config to apply.