@gtbl2012 opened this Pull Request on February 23rd 2021 Contributor

Description:

In current piwik tracker, the 'setUserId' using 'isNumberOrHasLength' to check the 'userId'.

this.setUserId = function (userId) {
    if (isNumberOrHasLength(userId)) {
        configUserId = userId;
    }
};

while the 'getRequest' function using '(configUserId && configUserId.length)' to check the 'userId'.

((configUserId && configUserId.length) ? '&uid=' + encodeWrapper(configUserId) : '')

Which causing user can set a userId in number and verify it by 'getUserId' func, but the userId cannot be reported.

This PR is to solve this confusing thing.

Review

  • [ ] Functional review done
  • [ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • [ ] Security review done see checklist
  • [ ] Code review done
  • [ ] Tests were added if useful/possible
  • [ ] Reviewed for breaking changes
  • [ ] Developer changelog updated if needed
  • [ ] Documentation added if needed
  • [ ] Existing documentation updated if needed
@diosmosis commented on February 23rd 2021 Member

Hi @gtbl2012, thanks for the great first contribution! This is indeed a problem, thanks for the fix!

This Pull Request was closed on February 23rd 2021
Powered by GitHub Issue Mirror