Skip to content

Commit

Permalink
Merge pull request #3375 from rbayet/fix-prevent-empty-null-tracker-s…
Browse files Browse the repository at this point in the history
…ession-identifiers-2.10.x

[Tracker] Ignore events with empty/null visitor/session identifiers (2.10.x)
  • Loading branch information
rbayet authored Sep 10, 2024
2 parents 2aa4b18 + 1828047 commit 364cca9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ protected function _construct()
* @param array $data Event data
*
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
protected function isEventInvalid($data)
{
Expand All @@ -248,6 +249,14 @@ protected function isEventInvalid($data)
if (array_key_exists('session', $data)) {
if (array_key_exists('uid', $data['session']) && array_key_exists('vid', $data['session'])) {
$isEventInvalid = false;
$sessionUid = trim($data['session']['uid']);
$sessionVid = trim($data['session']['vid']);
if (empty($sessionUid) || ("null" === $sessionUid)) {
$isEventInvalid = true;
}
if (empty($sessionVid) || ("null" === $sessionVid)) {
$isEventInvalid = true;
}
}
}
}
Expand Down

0 comments on commit 364cca9

Please sign in to comment.