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

Bugfix extra autoroute slashes #2308

Merged
merged 1 commit into from
Oct 8, 2019

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Oct 7, 2019

Description
When controller and method are both empty and there is no explicit default route (i.e. $routes->get('/', ...) then Router will call validateRequest() with two blank entries in $segments, which in turn calls setDirectory('') twice resulting in a directory of //. This causes autoroute() to fail to locate existing controllers.

This PR has setDirectory() ignore empty requests, since $this->directory of null is already equivalent to /.

Fix for #2301

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell lonnieezell merged commit c2407a1 into codeigniter4:develop Oct 8, 2019
@MGatner MGatner deleted the autoroute-slashes branch October 8, 2019 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants