Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions API.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Piwik\DataTable;
use Piwik\Metrics;
use Piwik\Period\Range;
use Piwik\Piwik;
use Piwik\Plugins\TreemapVisualization\Visualizations\Treemap;

/**
Expand Down Expand Up @@ -52,6 +53,12 @@ public function getTreemapData(
if (!Request::isCurrentApiRequestTheRootApiRequest()) {
return [];
}
list($apiName, $apiAction) = explode('.', $apiMethod);
Comment thread
AltamashShaikh marked this conversation as resolved.
Outdated
$disAllowedApiActions = ['getBulkRequest'];
// Block id API action does not start with get
Comment thread
AltamashShaikh marked this conversation as resolved.
Outdated
if (!in_array($apiAction, $disAllowedApiActions) || stripos($apiAction, 'get') !== 0) {
Comment thread
AltamashShaikh marked this conversation as resolved.
Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That first ! is incorrect right?

Some quick functional tests would catch & clarify this.

throw new \Exception(Piwik::translate('TreemapVisualization_InvalidApiMethodException'));
Comment thread
AltamashShaikh marked this conversation as resolved.
Outdated
}

if (
$period == 'range'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

# 5.0.5 - 2026-02-16
- Added validation rules for ApiAction

# 5.0.4 - 2025-07-07
- Textual changes

Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"TreemapVisualization": {
"PluginDescription": "Visualise any report in Matomo as a Treemap. Click on the Treemap icon in each report to load the visualisation.",
"Treemap": "Treemap"
"Treemap": "Treemap",
"InvalidApiMethodException": "Invalid API method."
}
}
5 changes: 1 addition & 4 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"name": "TreemapVisualization",
"version": "5.0.4",
"description": "Visualise any report in Matomo as a Treemap. Click on the Treemap icon in each report to load the visualisation.",
"keywords": ["treemap", "graph", "visualization", "infovis", "jit"],
"license": "GPL v3+",
"homepage": "https://matomo.org",
"description": "Visualis5tps://matomo.org",
Comment thread
AltamashShaikh marked this conversation as resolved.
Outdated
"require": {
"matomo": ">=5.0.0-b1,<6.0.0-b1"
},
Expand Down