How to get href="tel:phonenumber" working? | Community
Skip to main content
anjali_biddanda
Level 4
October 16, 2015
Solved

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

  • October 16, 2015
  • 11 replies
  • 6561 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by leeasling

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)*"/>

11 replies

edubey
Level 10
October 16, 2015

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

smacdonald2008
Level 10
October 16, 2015

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

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

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

leeaslingAccepted solution
Level 8
October 16, 2015

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)*"/>
anjali_biddanda
Level 4
October 16, 2015

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.

anjali_biddanda
Level 4
October 16, 2015

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

anjali_biddanda
Level 4
October 16, 2015

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)

anjali_biddanda
Level 4
October 16, 2015

Attachments added here.

edubey
Level 10
October 16, 2015

@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.

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

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