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

Incorrect routing caused by str_replace in Uri::init() #2754

Closed
hundblue opened this issue Dec 7, 2019 · 0 comments
Closed

Incorrect routing caused by str_replace in Uri::init() #2754

hundblue opened this issue Dec 7, 2019 · 0 comments
Assignees
Labels

Comments

@hundblue
Copy link

hundblue commented Dec 7, 2019

There are still (even after fixing #1892) occurences of incorrect use of str_replace in Uri::init(). In particular:
$uri = str_replace(static::filterPath($this->root), '', $this->url);
Instead of removing just the prefix, each occurence of the string being searched for is removed. This results in undesired route aliasing. Example:
https://learn.getgrav.org/16/content/rouhttps://learn.getgrav.orgting
is presently an alias of
https://learn.getgrav.org/16/content/routing.

Another not yet solved case of incorrect route aliasing is that of a fake hostname:
https://learn.getgrav.org/16//FAKE_HOSTNAME/content/routing (issue #2184)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants