Skip to content

[Bug]If the parameter appears in the middle, there will be a problem #4

@hoythan

Description

@hoythan
$keys = [];
$re = PathToRegexp::convert('/user/:id/avatar', $keys);
PathToRegexp::match($re, '/user/12345/avatar');

At this time, $Keys will be repeated twice

array(2) {
  [0]=>
  array(4) {
    ["name"]=>
    string(6) "id"
    ["delimiter"]=>
    string(1) "/"
    ["optional"]=>
    bool(false)
    ["repeat"]=>
    bool(false)
  }
  [1]=>
  array(4) {
    ["name"]=>
    string(6) "id"
    ["delimiter"]=>
    string(1) "/"
    ["optional"]=>
    bool(false)
    ["repeat"]=>
    bool(false)
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions