Skip to content

Commit 19b180b

Browse files
Take care of null values for in_array and stripos
1 parent c0a0747 commit 19b180b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

API.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getTreemapData(
5757
list($module, $method) = explode('.', $apiMethod);
5858
$disAllowedApiActions = ['getBulkRequest'];
5959
// Block if API action does not start with get
60-
if (in_array($method, $disAllowedApiActions) || stripos($method, 'get') !== 0) {
60+
if (!$method || in_array(strtolower($method), $disAllowedApiActions) || stripos($method, 'get') !== 0) {
6161
throw new BadRequestException(Piwik::translate('TreemapVisualization_InvalidApiMethodException'));
6262
}
6363

0 commit comments

Comments
 (0)