Expand my Community achievements bar.

SOLVED

How to get href="tel:phonenumber" working?

Avatar

Level 4

Hi,

 

I've seen your discussions in https://forums.adobe.com/thread/1127899 regarding the same.

 

I'd already tried adding 'tel:' to 'Special Link Prefix' in CQ Link Checker Service configuration. I've also tried adding x-cq-linkchecker="skip" to the <a> tags. I'm using AEM6. I'm using a sightly template - does this x-cq-linkchecker="skip" work in Sightly?

 

I've followed your steps and added a com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl under /apps/<myapp>/config, and no luck!

 

I've also tried turning off linkchecker entirely by disabling it in Day CQ Link Checker Transformer. And this has no effect! 

 

Any help will be appreciated.

 

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 8

You need to overlay /libs/cq/xssprotection/config.xml in apps and modify the configuration, specifically the "offsiteURL" regular expression on line 58 (in 6.1).

<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&amp;;:\-_~,\?=/!\*\(\)]*(\s)*"/>

You can change to:

<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:|tel:)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&amp;;:\-_~,\?=/!\*\(\)]*(\s)*"/>

View solution in original post

11 Replies

Avatar

Level 10

Not sure what exactly going on, Can you tell me how you are trying to verify whether its working or not ?

Avatar

Level 10

Try writing this component in JSP and see if it works. It may be a Sightly issue. 

Avatar

Employee Advisor

I tried to create a link with the protocol "tel" in Geometrixx and it worked perfectly (was rendered as link, although my desktop browser cannot cope with it). How does the system behave when you create such a link? Is there something in the logs?

kind regards,
Jörg

Avatar

Correct answer by
Level 8

You need to overlay /libs/cq/xssprotection/config.xml in apps and modify the configuration, specifically the "offsiteURL" regular expression on line 58 (in 6.1).

<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&amp;;:\-_~,\?=/!\*\(\)]*(\s)*"/>

You can change to:

<regexp name="offsiteURL" value="(\s)*((ht|f)tp(s?)://|mailto:|tel:)[\p{L}\p{N}]+[\p{L}\p{N}\p{Zs}\.\#@\$%\+&amp;;:\-_~,\?=/!\*\(\)]*(\s)*"/>

Avatar

Level 4

edubey, it's when I add a link to text inside a rich text editor (out of the box Text component). See my previous reply to Jorg.

Thanks.

Avatar

Level 4

leeasling!!! Thank you thank you!!!! This hasn't been mentioned anywhere else. That worked like a charm. 

Avatar

Level 4

Hi Jorg,

Thanks for trying on geometrixx. When I try it in Geometrixx, the href is not added for the <a> because the href value entered could not be processed. (see logs below). But when i enter mailto: which is one of the prefixs, then it works as expected and the href is added to <a>. See attachments. I've created a com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl under /apps/<myapp>/config.

Log extract:

03.08.2015 12:17:10.827 *INFO* [127.0.0.1 [1438568230824] GET /content/geometrixx/en/services/banking/jcr:content/par/text_1.html HTTP/1.1] com.adobe.granite.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The a tag contained an attribute that we could not process. The adhocenable attribute has been filtered out, but the tag is still in place. The value of the attribute was "false".
03.08.2015 12:17:10.827 *INFO* [127.0.0.1 [1438568230824] GET /content/geometrixx/en/services/banking/jcr:content/par/text_1.html HTTP/1.1] com.adobe.granite.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The a tag contained an attribute that we could not process. The href attribute had a value of "tel&#58;234324". 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.
03.08.2015 12:17:23.002 *INFO* [pool-9-thread-1] com.day.crx.security.token.impl.TokenCleanupTask TokenCleanupTask: Removed 0 token(s) in 2ms (3 token(s) still active)

Avatar

Level 10

@anjali, thanks for screenshots

I have created simple components, it seems to working fine with geometrixx site.

Please download : Text Component

One Suggestion: I didn't changed any configuration and setting to make this work, so please revert all your changes.

let me know how it goes.

Avatar

Employee Advisor

Hi,

looks like the embedded antisammy doesn't like your input. You might check the antisammy config at /libs/cq/xssprotection/config.xml. But antisammy does not check the protocol string (and you provided the proper config to the Linkchecker, so I am slightly confused here.

kind regards,
Jörg

Avatar

Level 4

And thank you to Jorg and edubey too for your input.