Skip to content

Commit 90b85b1

Browse files
author
Amrouche Hamza
committed
[FrameworkBundle] Fix a bug where a color tag will be shown when passing an antislash
1 parent 72d0a04 commit 90b85b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Console/Descriptor/TextDescriptor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
1313

14+
use Symfony\Component\Console\Formatter\OutputFormatter;
1415
use Symfony\Component\Console\Helper\Table;
1516
use Symfony\Component\Console\Style\SymfonyStyle;
1617
use Symfony\Component\DependencyInjection\Alias;
@@ -226,7 +227,8 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
226227
$rawOutput = isset($options['raw_text']) && $options['raw_text'];
227228
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
228229
$definition = $this->resolveServiceDefinition($builder, $serviceId);
229-
$styledServiceId = $rawOutput ? $serviceId : sprintf('<fg=cyan>%s</fg=cyan>', $serviceId);
230+
231+
$styledServiceId = $rawOutput ? $serviceId : sprintf('<fg=cyan>%s</fg=cyan>', OutputFormatter::escape($serviceId));
230232
if ($definition instanceof Definition) {
231233
if ($showTag) {
232234
foreach ($definition->getTag($showTag) as $key => $tag) {

0 commit comments

Comments
 (0)