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

Do not overwrite piwikUrl when host is localhost #9481

Closed
mgonera opened this issue Jan 7, 2016 · 5 comments
Closed

Do not overwrite piwikUrl when host is localhost #9481

mgonera opened this issue Jan 7, 2016 · 5 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mgonera
Copy link

mgonera commented Jan 7, 2016

When Piwik is accessed via localhost URL then piwikUrl in piwik_option DB table is overwritten with such URL. This is later causing images in e-mail reports being linked to localhost, so they are not displayed. The fix I discussed with @mattab is to make sure that piwikUrl is not overwritten with localhost or 127.0.0.1 etc.

@mattab mattab added this to the 2.16.0 milestone Jan 7, 2016
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Jan 7, 2016
@tsteur
Copy link
Member

tsteur commented Jan 11, 2016

This also applies to 127.0.0.1 or 192.168.. , 10...*

@tsteur
Copy link
Member

tsteur commented Jan 11, 2016

Actually 192.168.. , 10..., ... (private IPs) might be ok if used in an intranet

@quba
Copy link
Contributor

quba commented Jan 11, 2016

What's the reason for updating this value in piwik_option? Woulnd't it possible to just use one specific URL (e.g. the first trusted host)?

@tsteur
Copy link
Member

tsteur commented Jan 11, 2016

I don't know. I reckon it's to use the address that users usually actually use. Say there are 3 trusted hosts mentioned but only one is actually used by all of them. So we use the URL that was actually used. Doesn't really work though when different users use different URLs and would be confusing. So I guess there's another reason for this. Maybe @mattab knows more

@mattab
Copy link
Member

mattab commented Jan 12, 2016

yes, it's meant to select the Piwik URL that was last used. this feature was implemented before we had trusted hosts entries in the config file... but in general we couldn't unfortunately just use the trusted host, because 1) it would be BC break in 2.X, and 2) Piwik may be installed in a sub-path and the trusted host entries only contain the hostname

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.
Projects
None yet
Development

No branches or pull requests

4 participants