Bug #95607
closedKeyword "new" leads to corrupt DependencyInjectionContainer_...php
100%
Description
I defined a console command through the Services.yaml. And whenever i use the word “new” inside of my command description, the whole dependencyInjection container breaks. It replaces my description with the string:
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(
Steps to reproduce:
1. Create a new console command in your Services.yaml eg:
services: My\Great\Command\SmthCommand: tags: - name: 'console.command' command: 'do:sth' description: 'This is a cool new Command' schedulable: false
2. Clear the cache: vendor/bin/typo3 cache:flush
Since the Description includes the word "new" the cached DependencyInjectionContainer class beneath var/ will result in:
$a->addLazyCommand('do:sth', 'My\\Great\\Command\\SmthCommand', 'This is a cool \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstanceForDi(Command', false, false, NULL);
Updated by Dennis Römmich about 3 years ago
I guess the replacement of the word "new" is located here: https://github.com/TYPO3/typo3/blob/v11.5.0/typo3/sysext/core/Classes/DependencyInjection/ContainerBuilder.php#L166
Updated by Gerrit Code Review about 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71606
Updated by Gerrit Code Review about 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71606
Updated by Benjamin Franzke about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 45ad8375694b8dd570d645a6ce517fa1b63b9ffd.
Updated by Oliver Bartsch over 2 years ago
- Related to Bug #97522: Word "new" in command "description" breaks DI added
Updated by Benjamin Franzke about 2 years ago
- Has duplicate Bug #99128: Symfony Command: Keyword 'new' breaks DependencyInjectionContainer file added