Skip to content

[BUG]: Router no longer matches with query strings #16749

@raicabogdan

Description

@raicabogdan

Describe the bug
When you use query strings in URLs, the router no longer matches the specific route without the query string.

To Reproduce

router->handle(
    '/admin/private/businesses/list/my/123?varname=1234'
);

There was 1 failure:
1) HandleCest: Test Mvc\Router - handle() - with placeholders
 Test  tests/integration/Mvc/Router/HandleCest.php:mvcRouterHandleWithPlaceholders
 Step  Assert equals "admin",""
 Fail  Failed asserting that two strings are equal.
- Expected | + Actual
@@ @@
-'admin'
+''

Scenario Steps:

 1. $I->assertEquals("admin","") at tests/integration/Mvc/Router/HandleCest.php:131


FAILURES!
Tests: 8, Assertions: 27, Failures: 1.

Steps to reproduce the behavior:
Add a query string to a url and try accessing the url

Expected behavior
I expect the route to be matched correctly.

Screenshots
If applicable, add screenshots to help explain your problem.

Details

  • Phalcon version: 5.9.2
  • PHP Version: PHP 8.4.5
  • Operating System: Docker php84
  • Installation type: Compiling from source
  • Zephir version (if any): 0.18.0
  • Server: php built-in server with .htrouter

Additional context
I believe bug was introduced from issue #16741

Metadata

Metadata

Assignees

No one assigned

    Labels

    5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: highHigh

    Type

    Projects

    Status

    Implemented

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions