10000 A binary char in the value of any parameter breaks the command debug:router · Issue #49638 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

A binary char in the value of any parameter breaks the command debug:router #49638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vtsykun opened this issue Mar 8, 2023 · 0 comments
Closed

Comments

@vtsykun
Copy link
Contributor
vtsykun commented Mar 8, 2023

Symfony version(s) affected

5.4.21

Description

I am getting an exception when I run the command debug:router

In XmlFileLoader.php line 407:
                                                                                                                                                                             
  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]                                                                                                 
  Unable to parse file "/var/www/packeton5/var/cache/dev/Packeton_KernelDevDebugContainer.xml": [ERROR 522] Validation failed: no DTD found ! (in n/a - line 2, column 229)  
  [ERROR 9] PCDATA invalid Char value 27 (in n/a - line 169, column 1)                                                                                                       
  [ERROR 9] PCDATA invalid Char value 27 (in n/a - line 169, column 15)                                                                                                      
  [ERROR 9] PCDATA invalid Char value 27 (in n/a - line 169, column 31)                                                                                                      
  [ERROR 9] PCDATA invalid Char value 27 (in n/a - line 170, column 1)                                                                                                       
  [ERROR 9] PCDATA invalid Char value 27 (in n/a - line 170, column 16)                                                                                                      
  [ERROR 9] PCDATA invalid Char value 27 (in n/a - line 170, column 31)                                                                                                      
                                                                                                                                                                             

Exception trace:
  at /var/www/packeton5/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php:407
 Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM() at /var/www/packeton5/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php:50
 Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load() at /var/www/packeton5/vendor/symfony/framework-bundle/Command/BuildDebugContainerTrait.php:53
 Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand->getContainerBuilder() at /var/www/packeton5/vendor/symfony/framework-bundle/Command/RouterDebugCommand.php:90
 Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand->Symfony\Bundle\FrameworkBundle\Command\{closure}() at /var/www/packeton5/vendor/symfony/framework-bundle/Console/Descriptor/TextDescriptor.php:579
 Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->formatControllerLink() at /var/www/packeton5/vendor/symfony/framework-bundle/Console/Descriptor/TextDescriptor.php:65
 Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describeRouteCollection() at /var/www/packeton5/vendor/symfony/framework-bundle/Console/Descriptor/Descriptor.php:47
 Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor->describe() at /var/www/packeton5/vendor/symfony/console/Helper/DescriptorHelper.php:65
 Symfony\Component\Console\Helper\DescriptorHelper->describe() at /var/www/packeton5/vendor/symfony/framework-bundle/Command/RouterDebugCommand.php:132
 Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand->execute() at /var/www/packeton5/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /var/www/packeton5/vendor/symfony/console/Application.php:1058
 Symfony\Component\Console\Application->doRunCommand() at /var/www/packeton5/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/packeton5/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at /var/www/packeton5/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/packeton5/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /var/www/packeton5/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at /var/www/packeton5/vendor/autoload_runtime.php:35
 require_once() at /var/www/packeton5/bin/console:11

How to reproduce

Add any parameter into config file, for example

parameters:
    show_info_cmd_message: "\u001b[37;44m#StandWith\u001b[30;43mUkraine\u001b[0m"

Possible Solution

Remove binary data form DebugContainer.xml

Additional Context

Selection_1331
Selection_1332

@vtsykun vtsykun added the Bug label Mar 8, 2023
nicolas-grekas added a commit that referenced this issue Mar 10, 2023
…ers. (vtsykun)

This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Fix support binary values in parameters.

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #49638
| License       | MIT
| Doc PR        | -

This issue related to #25928

### Step to reproduce

1. Add parameter like this
```yaml
parameters:
    banner_message: "\e[37;44m#StandWith\e[30;43mUkraine\e[0m"
```

2. Run command `debug:router`

Actual result:

![Selection_1343](https://user-images.githubusercontent.com/21358010/224194622-6d814bbc-823d-43db-8e11-43a46f09ad57.png)

Commits
-------

8541643 Fix support binary values in parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0