Skip to content

Commit

Permalink
Make sure base URI with a fragment is not used in resolve-uri()
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Oct 2, 2023
1 parent 1a17545 commit 96131a2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1092,9 +1092,9 @@ WHERE

<!-- intercept all HTML and SVG link clicks except to /uploads/ and those in the navbar (except breadcrumb bar, .brand and app list) and the footer -->
<!-- resolve URLs against the current document URL because they can be relative -->
<xsl:template match="a[not(@target)][starts-with(resolve-uri(@href, ac:uri()), 'http://') or starts-with(resolve-uri(@href, ac:uri()), 'https://')][not(starts-with(resolve-uri(@href, ac:uri()), resolve-uri('uploads/', $ldt:base)))][ancestor::div[@id = 'breadcrumb-nav'] or not(ancestor::div[tokenize(@class, ' ') = ('navbar', 'footer')])] | a[contains-token(@class, 'brand')] | div[button[contains-token(@class, 'btn-apps')]]/ul//a | svg:a[not(@target)][starts-with(resolve-uri(@href, ac:uri()), 'http://') or starts-with(resolve-uri(@href, ac:uri()), 'https://')][not(starts-with(resolve-uri(@href, ac:uri()), resolve-uri('uploads/', $ldt:base)))]" mode="ixsl:onclick">
<xsl:template match="a[not(@target)][starts-with(resolve-uri(@href, ac:document-uri(ac:uri())), 'http://') or starts-with(resolve-uri(@href, ac:document-uri(ac:uri())), 'https://')][not(starts-with(resolve-uri(@href, ac:document-uri(ac:uri())), resolve-uri('uploads/', $ldt:base)))][ancestor::div[@id = 'breadcrumb-nav'] or not(ancestor::div[tokenize(@class, ' ') = ('navbar', 'footer')])] | a[contains-token(@class, 'brand')] | div[button[contains-token(@class, 'btn-apps')]]/ul//a | svg:a[not(@target)][starts-with(resolve-uri(@href, ac:document-uri(ac:uri())), 'http://') or starts-with(resolve-uri(@href, ac:document-uri(ac:uri())), 'https://')][not(starts-with(resolve-uri(@href, ac:document-uri(ac:uri())), resolve-uri('uploads/', $ldt:base)))]" mode="ixsl:onclick">
<xsl:sequence select="ixsl:call(ixsl:event(), 'preventDefault', [])"/>
<xsl:variable name="href" select="resolve-uri(@href, ac:uri())" as="xs:anyURI"/> <!-- resolve relative URIs -->
<xsl:variable name="href" select="resolve-uri(@href, ac:document-uri(ac:uri()))" as="xs:anyURI"/> <!-- resolve relative URIs -->

<ixsl:set-style name="cursor" select="'progress'" object="ixsl:page()//body"/>

Expand Down

0 comments on commit 96131a2

Please sign in to comment.