Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0239d4a

Browse files
committed
bug #16733 [Console] do not encode backslashes in console default description (Tobion)
This PR was merged into the 2.3 branch. Discussion ---------- [Console] do not encode backslashes in console default description | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16420 | License | MIT | Doc PR | - Commits ------- 873a541 [Console] do not encode backslashes in console default description
2 parents b2899a6 + 873a541 commit 0239d4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Console/Descriptor/TextDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ protected function describeApplication(Application $application, array $options
187187
private function formatDefaultValue($default)
188188
{
189189
if (PHP_VERSION_ID < 50400) {
190-
return str_replace('\/', '/', json_encode($default));
190+
return str_replace(array('\/', '\\\\'), array('/', '\\'), json_encode($default));
191191
}
192192

193-
return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
193+
return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
194194
}
195195

196196
/**

0 commit comments

Comments
 (0)