From 019ce0114819d2a88a535fd0f122244ed3406bfa Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Sun, 30 Sep 2018 22:43:06 +0200 Subject: Fix various notices caused by invalid parameter values (#13511) * Properly check dates used for period factory * Properly check given idSite for rowevolution * Improve example API to check given parameter type * cast idSite parameter in ImageGraph API method --- plugins/API/API.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins/API') diff --git a/plugins/API/API.php b/plugins/API/API.php index fa913d887f..6f968a3efe 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -449,6 +449,10 @@ class API extends \Piwik\Plugin\API */ public function getRowEvolution($idSite, $period, $date, $apiModule, $apiAction, $label = false, $segment = false, $column = false, $language = false, $idGoal = false, $legendAppendMetric = true, $labelUseAbsoluteUrl = true, $idDimension = false) { + // check if site exists + $idSite = (int) $idSite; + $site = new Site($idSite); + Piwik::checkUserHasViewAccess($idSite); $apiParameters = array(); -- cgit v1.2.3