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

If available, use SERVER_PORT variable as well as SERVER_NAME. #16186

Merged
merged 4 commits into from Jul 7, 2020

Conversation

diosmosis
Copy link
Member

Otherwise an install on a non-standard port will not pass the trusted hosts check.

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 7, 2020
@diosmosis diosmosis added this to the 4.0.0 milestone Jul 7, 2020
@tsteur
Copy link
Member

tsteur commented Jul 7, 2020

@diosmosis some tests seem to be failing now: eg https://travis-ci.org/github/matomo-org/matomo/jobs/705628957#L669

Otherwise all good to merge

&& $_SERVER['SERVER_PORT'] != 443
) {
$k_path_url .= ':' . $_SERVER['SERVER_PORT'];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for not directly using

$k_path_url .= Url::getHostFromServerNameVar();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was part of a library so I didn't want it to depend on Matomo, but looking at the path above, I guess it's actually Matomo code?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's our configuration for tcpdf. Even though I think some parts of that config could maybe meanwhile be removed.

@diosmosis
Copy link
Member Author

Updated and fixed the tests.

@tsteur tsteur merged commit 391165a into 4.x-dev Jul 7, 2020
@tsteur tsteur deleted the server-name-port branch July 7, 2020 21:28
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 not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants