Issue Bug Closed

#95607Keyword "new" leads to corrupt DependencyInjectionContainer_...php

Dennis Römmich 10/12/21, 16:55 updated 10/04/22, 14:12

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);

Reviews 1