File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -77,19 +77,21 @@ public function setParams($params)
77
77
}
78
78
79
79
// Match the route item against the request method and URI
80
-
81
80
public function match ($ request_method , $ request_uri )
82
81
{
83
- $ request_uri = rtrim ($ request_uri , '/ ' );
84
- if ($ this ->method === $ request_method && preg_match ($ this ->pathRegex [$ this ->path ], $ request_uri , $ matches )) {
82
+ $ parsed_url = parse_url ($ request_uri );
83
+ $ request_path = $ parsed_url ['path ' ];
84
+
85
+ $ request_path = rtrim ($ request_path , '/ ' );
86
+ if ($ this ->method === $ request_method && preg_match ($ this ->pathRegex [$ this ->path ], $ request_path , $ matches )) {
85
87
$ this ->params = array_slice ($ matches , 1 );
86
88
return true ;
87
89
}
90
+
88
91
return false ;
89
92
}
90
93
91
94
// Execute the controller method associated with this route item
92
-
93
95
public function execute ()
94
96
{
95
97
if (is_callable ($ this ->controller )) {
You can’t perform that action at this time.
0 commit comments