8000 Strange route prefix being added · Issue #32159 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Strange route prefix being added #32159
Closed
@WubbleWobble

Description

@WubbleWobble

Symfony version(s) affected: 4.3.1

Description
On a clean install of Symfony 4.3.1 (full/traditional web app version version), routes generated with annotations look to be broken as "<href=>" has been prefixed to the route paths.

Edit: Now pretty sure this is just a formatting issue with the path on the debug:router command (see below).

How to reproduce

  1. symfony new --version=4.3 --full s43.symf
  2. Add TestController.php as follows:
<?php

namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class TestController
{
    /** @Route("/wibble") */
    public function test() {
        return new Response("Boop boop");
    }
}
  1. bin/console debug:router
 -------------------------- -------- -------- ------ ----------------------------------- 
  Name                       Method   Scheme   Host   Path                               
 -------------------------- -------- -------- ------ ----------------------------------- 
  _twig_error_test           ANY      ANY      ANY    /_error/{code}.{_format}           
  _wdt                       ANY      ANY      ANY    /_wdt/{token}                
  ... snip ...
  app_test_test              ANY      ANY      ANY    <href=>/wibble                     
 -------------------------- -------- -------- ------ ----------------------------------- 

Edit:
It looks like the route is still matched correctly...

bin/console router:match /wibble


+--------------+---------------------------------------------------------+
| Property     | Value                                                   |
+--------------+---------------------------------------------------------+
| Route Name   | app_test_test                                           |
| Path         | /wibble                                                 |
| Path Regex   | #^/wibble$#sDu                                          |
| Host         | ANY                                                     |
| Host Regex   |                                                         |
| Scheme       | ANY                                                     |
| Method       | ANY                                                     |
| Requirements | NO CUSTOM                                               |
| Class        | Symfony\Component\Routing\Route                         |
| Defaults     | _controller: App\Controller\TestController::test        |
| Options      | compiler_class: Symfony\Component\Routing\RouteCompiler |
|              | utf8: true                                              |
+--------------+---------------------------------------------------------+

... so this is possibly just a path formatting issue on the debug command?

Additional Context
Also tried this with 4.2, which worked as expected.

Also tried adding a route via routes.yaml, which was similarly affected

index:
    path: /wooo
    controller: App\Controller\TestController::test

PHP version used:
PHP 7.1.30-1+ubuntu19.04.1+deb.sury.org+1 (cli) (built: May 31 2019 11:44:30) ( NTS )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0