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

Prevent reverseRoute from searching closures #1959

Merged

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Apr 21, 2019

Description
reverseRoute searches loaded routes for a string match, but will throw an exception on unmatched routes when it tries to trim any routes whose definitions are closures. This ignores non-string destinations in the secondary search phase.
Fix for #1953

Checklist:

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

@MGatner
Copy link
Member Author

MGatner commented May 14, 2019

I believe this is still relevant, and would be cause testReverseRoutingReturnsFalseWithNoMatch() to fail except that it isn't loading default routes from system/Config/Routes.php which include Closures. I'm adding a test to demonstrate the failure.

@lonnieezell lonnieezell merged commit 2133346 into codeigniter4:develop May 14, 2019
@MGatner MGatner deleted the route-search-exempt-closures branch May 14, 2019 20:14
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.

None yet

2 participants