Skip to content

Bug: Route redirection not working #3041

@MichalPB1

Description

@MichalPB1

Describe the bug
After using

$routes->addRedirect('example', 'profile/dashboard');

I get an error

key() expects parameter 1 to be array, string given

but if the second param I set as named route then everything is working properly. The problem exists only when the second param is a URI

CodeIgniter 4 version
4.0.2

Affected module(s)

Router/Router.php at line 430

I not sure but here I found some changes for this line https://github.com/codeigniter4/CodeIgniter4/pull/2481/files#diff-d2374d65fd714c18dbee9f5adaa8dd6cL488

Expected behavior, and steps to reproduce if appropriate
Redirection working properly for the second param as a URI .

Context

  • OS: Ubuntu
  • PHP version 7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions