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

fix: TypeError for routes when translateURIDashes is enabled #9209

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

maniaba
Copy link
Contributor

@maniaba maniaba commented Oct 2, 2024

Description
This pull request addresses a TypeError that occurs in CodeIgniter 4 when the translateURIDashes property is set to true in the Routes.php configuration file and an OPTIONS route is defined using a closure. The error message indicates that the str_replace() function receives a Closure instead of the expected string or array.

Related Issue:
Fixes #9208

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn
Copy link
Member

michalsn commented Oct 2, 2024

Can you add a test?

@kenjis kenjis added tests needed Pull requests that need tests bug Verified issues on the current code behavior or pull requests that will fix them labels Oct 3, 2024
@michalsn
Copy link
Member

michalsn commented Oct 4, 2024

@maniaba Sorry, I forgot about it earlier, but a changelog entry would be nice too 😅 https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/changelogs/v4.5.6.rst

Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

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

Thank you!

@michalsn michalsn removed the tests needed Pull requests that need tests label Oct 4, 2024
@michalsn michalsn merged commit 3435872 into codeigniter4:develop Nov 3, 2024
42 checks passed
@maniaba maniaba deleted the fix branch November 3, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: TypeError when translateURIDashes is enabled with routes
4 participants