CodeIgniter4
CodeIgniter4 copied to clipboard
fix: TypeError for routes when translateURIDashes is enabled
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
Can you add a test?
@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