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

piwikUrl.getSearchParam() should not set an empty URL value #12728

Merged
merged 1 commit into from Apr 23, 2018

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 16, 2018

This fixes an issue that when changing for example the date, suddenly the log in screen is shown.

For example in a plugin I do

var tokenAuth = piwikUrl.getSearchParam('token_auth')

Which then sets indirectly $search.token_auth='' which then results in &token_auth=undefined in the URL. Meaning it will try to authenticate the user for the token undefined which won't work. Also I think in general we should not append the URL accidentally ever to the URL in the browser.

Ideally, the getSearchParam() method should certainly not set a value indirectly here and it is a bug but not sure what side effects we would run into by removing the search[paramName] = paramUrlValue;

See DEV-1316

This fixes an issue that when changing for example the date, suddenly the log in screen is shown.

For example in a plugin I do

`var tokenAuth = piwikUrl.getSearchParam('token_auth')`

Which then sets indirectly `$search.token_auth=''` which then results in `&token_auth=undefined` in the URL. Meaning it will try to authenticate the user for the token `undefined` which won't work. Also I think in general we should not append the URL accidentally ever to the URL in the browser. 

Ideally, the `getSearchParam()` method should certainly not set a value indirectly here and it is a bug but not sure what side effects we would run into by removing the `search[paramName] = paramUrlValue;`

See DEV-1316
@tsteur tsteur added the Needs Review PRs that need a code review label Apr 16, 2018
@tsteur tsteur added this to the 3.5.0 milestone Apr 16, 2018
@mattab mattab merged commit eff059c into 3.x-dev Apr 23, 2018
@mattab mattab deleted the getsearchparam branch April 23, 2018 04:09
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
…rg#12728)

This fixes an issue that when changing for example the date, suddenly the log in screen is shown.

For example in a plugin I do

`var tokenAuth = piwikUrl.getSearchParam('token_auth')`

Which then sets indirectly `$search.token_auth=''` which then results in `&token_auth=undefined` in the URL. Meaning it will try to authenticate the user for the token `undefined` which won't work. Also I think in general we should not append the URL accidentally ever to the URL in the browser. 

Ideally, the `getSearchParam()` method should certainly not set a value indirectly here and it is a bug but not sure what side effects we would run into by removing the `search[paramName] = paramUrlValue;`

See DEV-1316
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