Skip to content

Commit

Permalink
Prevent errors if limitVisits is <= 0. (matomo-org#15336)
Browse files Browse the repository at this point in the history
If set to 0 or less than 0, all rows will be removed from result set, but the code assumes at least one row exists, which results in errors.
  • Loading branch information
diosmosis authored and jonasgrilleres committed Sep 22, 2020
1 parent 427af33 commit eae44e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/Live/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function getVisitorProfile($idSite, $visitorId = false, $segment = false,
{
Piwik::checkUserHasViewAccess($idSite);

if ($limitVisits === false) {
if ($limitVisits <= 0) {
$limitVisits = VisitorProfile::VISITOR_PROFILE_MAX_VISITS_TO_SHOW;
} else {
$limitVisits = (int) $limitVisits;
Expand Down

0 comments on commit eae44e1

Please sign in to comment.