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
This commit is contained in:
Fabien Potencier 2015-11-29 11:50:28 +01:00
commit 0239d4ae7e
1 changed files with 2 additions and 2 deletions

View File

@ -187,10 +187,10 @@ class TextDescriptor extends Descriptor
private function formatDefaultValue($default)
{
if (PHP_VERSION_ID < 50400) {
return str_replace('\/', '/', json_encode($default));
return str_replace(array('\/', '\\\\'), array('/', '\\'), json_encode($default));
}
return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
}
/**