This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-19d10c14-7d30-4ec6-92a6-44c13a2a61df XWIKI-22321 Open

Typed URL links should not be displayed as wanted links when the URL is invalid

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-1b901e44-ccc5-4c89-b936-48e207354092 Vincent Massol created this issue on 10/Jul/24 14:59
 
Summary: Typed URL links should not be displayed as wanted links when the URL is invalid
Issue Type: cid:jira-generated-image-avatar-19d10c14-7d30-4ec6-92a6-44c13a2a61df Bug
Affects Versions: 15.10
Assignee: Unassigned
Components: Web - Templates & Resources
Created: 10/Jul/24 14:59
Priority: cid:jira-generated-image-static-major-c15c64ff-08a4-4d9b-b68b-0a7f784ffbae Major
Reporter: Vincent Massol
Description:

Example: [[label>>url:abc]].

What happens is that when we parse the link reference, we have a fallback in the URLResourceReferenceTypeParser code to fallback on an UNKNOWN type if the passed URL is not valid, but in DefaultLinkReferenceParser if the type is UNKNOWN we fallback to the untyped link reference parser, which considers it as a document reference, thus leading to a wanted link.

While it's good that the rendering code never breaks, the fallback seems wrong and we should probably end up with a broken HTML link instead, rather than a wanted link.

 
 

1 update

 
cid:jira-generated-image-avatar-1b901e44-ccc5-4c89-b936-48e207354092 Changes by Vincent Massol on 10/Jul/24 15:00
 
Description: Example: {{[[label>>url:abc]]}}.

What happens is that when we parse the link reference, we have a fallback in the {{URLResourceReferenceTypeParser}} code to fallback on an UNKNOWN type if the passed URL is not valid, but in {{DefaultLinkReferenceParser}} if the type is UNKNOWN we fallback to the untyped link reference parser, which considers it as a document reference, thus leading to a wanted link.

While it's good that the rendering code never breaks, the fallback seems wrong and we should probably end up with a broken HTML link instead, rather than a wanted link.


Note: I've created the issue in platform as wanted links are a platform feature, but the fix is likely in rendering and this issue might need to be moved.