CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

fix: TypeError for routes when translateURIDashes is enabled

Open maniaba opened this issue 1 year ago • 2 comments

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:

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

maniaba avatar Oct 02 '24 08:10 maniaba

Can you add a test?

michalsn avatar Oct 02 '24 13:10 michalsn

@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

michalsn avatar Oct 04 '24 06:10 michalsn