File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1313use Piwik \API \Request ;
1414use Piwik \Common ;
1515use Piwik \DataTable ;
16+ use Piwik \Http \BadRequestException ;
1617use Piwik \Metrics ;
1718use Piwik \Period \Range ;
1819use Piwik \Piwik ;
@@ -53,11 +54,11 @@ public function getTreemapData(
5354 if (!Request::isCurrentApiRequestTheRootApiRequest ()) {
5455 return [];
5556 }
56- list ($ apiName , $ apiAction ) = explode ('. ' , $ apiMethod );
57+ list ($ module , $ method ) = explode ('. ' , $ apiMethod );
5758 $ disAllowedApiActions = ['getBulkRequest ' ];
5859 // Block if API action does not start with get
59- if (! in_array ($ apiAction , $ disAllowedApiActions ) || stripos ($ apiAction , 'get ' ) !== 0 ) {
60- throw new \ Exception (Piwik::translate ('TreemapVisualization_InvalidApiMethodException ' ));
60+ if (in_array ($ method , $ disAllowedApiActions ) || stripos ($ method , 'get ' ) !== 0 ) {
61+ throw new BadRequestException (Piwik::translate ('TreemapVisualization_InvalidApiMethodException ' ));
6162 }
6263
6364 if (
You can’t perform that action at this time.
0 commit comments