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

url decode value in requestcommand #16301

Merged
merged 9 commits into from Aug 18, 2020
Merged

url decode value in requestcommand #16301

merged 9 commits into from Aug 18, 2020

Conversation

diosmosis
Copy link
Member

RequestCommand uses getArrayFromQueryString which doesn't urldecode. (Note: I'm using in this for UI tests in ProxySite since travis-ci will hang (probably deadlock) when using curl requests)

@diosmosis diosmosis added this to the 4.0.0 milestone Aug 16, 2020
@diosmosis diosmosis added the Needs Review PRs that need a code review label Aug 16, 2020
@tsteur
Copy link
Member

tsteur commented Aug 17, 2020

@diosmosis be good to add a test eg with segments that contains characters like ' " & < > to check it doesn't break anything there? The segment definition would be set when archiving.

@diosmosis
Copy link
Member Author

@tsteur ArchiveCronTest should archive segments (segments defined in ManySitesImportedLogs::getDefaultSegments()). is that enough?

@tsteur
Copy link
Member

tsteur commented Aug 17, 2020

@diosmosis I'm not sure. they don't seem to be encoded the way they are usually? Eg the 2 archives visitCount<=5;visitorType!=re%2C%3Btest%20is%20encoded;daysSinceFirstVisit<=50 and visitCount<=5;visitorType!=non-existing-type;daysSinceFirstVisit<=50 seem to have actually not valid segment values? I mean the visitorType wouldn't match those values I think. It be great if there was a segment definition like pageUrl=@ and then one or multiple URL encoded characters in the comparison string and this should actually match a value. Then we would know for sure that values are correctly forwarded and read by climulti.

@diosmosis
Copy link
Member Author

@tsteur uses a new segment type, hopefully the next build will pass

@tsteur
Copy link
Member

tsteur commented Aug 18, 2020

@diosmosis I suppose the changed values in tests are because of the segment change?

@diosmosis
Copy link
Member Author

@tsteur yes, matching less visits now

@diosmosis
Copy link
Member Author

also,when testing I added the changes to 4.x-dev, then switched over and checked the test results were the same on this branch

@tsteur
Copy link
Member

tsteur commented Aug 18, 2020

👍 LGTM

after some debugging noticed this works eg because we urlencode the segment here: https://github.com/matomo-org/matomo/blob/3.14.1-b1/core/CronArchive.php#L841

@diosmosis diosmosis merged commit 970e28a into 4.x-dev Aug 18, 2020
@diosmosis diosmosis deleted the request-command-decode branch August 18, 2020 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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