Skip to content

Improvements in treemap node URL handling, AS-706 - #102

Merged
lachiebol merged 5 commits into
5.x-devfrom
AS-706
Sep 2, 2026
Merged

lachiebol merged 5 commits into
5.x-devfrom
AS-706

Conversation

@AltamashShaikh

@AltamashShaikh AltamashShaikh commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Improvements in treemap node URL handling

Issue No

AS-706

Steps to Replicate the Issue

Checklist

  • [✔] Tested locally or on demo2/demo3?
  • [✔] New test case added/updated?
  • [NA] Are all newly added texts included via translation?
  • [NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue)
  • [✔] Version bumped?
  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules
  • [NA] Documentation updated?

AltamashShaikh and others added 3 commits September 1, 2026 19:43
The URL metadata of a report row is based on tracked data and can use any
scheme, so it is now filtered through UrlHelper::isLookLikeSafeUrl() before it
becomes part of the treemap data, checked again in the browser, and opened
without giving the new window access to the opener document.
@AltamashShaikh
AltamashShaikh requested a review from a team September 1, 2026 14:37
Comment thread javascripts/treemapViz.js Resolved

@lachiebol lachiebol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, is a fallback needed? Otherwise LGTM

Comment thread javascripts/treemapViz.js Resolved
window.vueSanitizeUrl was added in Matomo 5.11 while the plugin supports Matomo
5.0 and later, so the check in the browser is now only applied when the helper
exists. The URL is filtered server side in any case.

@lachiebol lachiebol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lachiebol
lachiebol merged commit a2eddfb into 5.x-dev Sep 2, 2026
8 checks passed
snake14 added a commit that referenced this pull request Sep 3, 2026
* Improvements in treemap node URL handling, AS-706 (#102)

The URL metadata of a report row is based on tracked data and can use any scheme,
so it is filtered through UrlHelper::isLookLikeSafeUrl() before it becomes part of
the treemap data, checked again in the browser, and opened without giving the new
window access to the opener document.

The 5.x guard around window.vueSanitizeUrl is dropped here, since every Matomo this
branch supports ships the helper.

(cherry picked from commit a2eddfb)

* Keep rows without a URL free of the link icon

A blank url metadata passes isLookLikeSafeUrl() and picks up the http:// prefix, so a
row such as "Page URL not defined" gains a link icon that opens the bare scheme.
The same fix is still owed on 5.x-dev.

* Release the treemap node URL handling as 6.0.1

---------

Co-authored-by: Altamash Shaikh <altamash@innocraft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants