Skip to content

fix: generate inputs for all route params in Debug Toolbar#9964

Merged
paulbalandan merged 1 commit intocodeigniter4:developfrom
michalsn:fix/toolbar-routes
Feb 20, 2026
Merged

fix: generate inputs for all route params in Debug Toolbar#9964
paulbalandan merged 1 commit intocodeigniter4:developfrom
michalsn:fix/toolbar-routes

Conversation

@michalsn
Copy link
Member

Description
This PR fixes a bug where only the first route parameter was converted to an input field on hover in the Debug Toolbar Routes panel.

The regex in routerLink() was missing the global flag (g), causing String.replace() to stop after the first match. The fix adds the g flag and simplifies the regex to /\(.+?\)/g. The replacement now also uses the actual matched pattern (e.g. ([0-9]+), (.*)) as the input placeholder instead of the literal $1.

Closes #7324
Ref: #3070

Checklist:

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

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 19, 2026
@paulbalandan paulbalandan merged commit 6ee78ae into codeigniter4:develop Feb 20, 2026
4 checks passed
@paulbalandan
Copy link
Member

Thank you, @michalsn

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: [DebugBar] regex vulnerable to super-linear runtime due to backtracking

3 participants

Comments