Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom tracking timestamp should return an integer to prevent HTTP 500 tracking error #17127

Merged
merged 2 commits into from Jan 21, 2021

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jan 20, 2021

Description:

Eg

curl -i -X POST -d '{"requests":["?idsite=1&rec=1&idgoal=21&apiv=1&_id=50d60fcd18ff0c7e&cdt=1610168419&revenue=0&send_image=0","?idsite=1&rec=1&idgoal=21&apiv=1&_id=50d60fcd18ff0c7e&cdt=1610168419&revenue=0&send_image=0"]}' http://your.site/matomo.php

Can trigger an HTTP 500 error when the request is authenticated (or when using a recent timestamp). That's because when for example A/B tests are configured, then it does a Date::factory($request->getCurrentTimestamp)) where the timestamp is a string and thus the Date class would trigger an exception.

Making sure we return an integer will fix all possible uses.

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

…0 tracking error

Eg 
```
curl -i -X POST -d '{"requests":["?idsite=1&rec=1&idgoal=21&apiv=1&_id=50d60fcd18ff0c7e&cdt=1610168419&revenue=0&send_image=0","?idsite=1&rec=1&idgoal=21&apiv=1&_id=50d60fcd18ff0c7e&cdt=1610168419&revenue=0&send_image=0"]}' http://your.site/matomo.php
```

Can trigger an HTTP 500 error when the request is authenticated (or when using a recent timestamp). That's because when for example A/B tests are configured, then it does a `Date::factory($request->getCurrentTimestamp))` where the timestamp is a `string` and thus the Date class would trigger an exception.

Making sure we return an integer will fix all possible uses.
@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Jan 20, 2021
@tsteur tsteur added this to the 4.2.0 milestone Jan 20, 2021
@diosmosis diosmosis merged commit 23d5517 into 4.x-dev Jan 21, 2021
@diosmosis diosmosis deleted the trackingerror branch January 21, 2021 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants