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)
7777 }
7878
7979 // Match the route item against the request method and URI
80-
8180 public function match ($ request_method , $ request_uri )
8281 {
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 )) {
8587 $ this ->params = array_slice ($ matches , 1 );
8688 return true ;
8789 }
90+
8891 return false ;
8992 }
9093
9194 // Execute the controller method associated with this route item
92-
9395 public function execute ()
9496 {
9597 if (is_callable ($ this ->controller )) {
You can’t perform that action at this time.
0 commit comments