8000 [DependencyInjection] Fix support binary values in parameters. by vtsykun · Pull Request #49651 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] Fix support binary values in parameters. #49651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

vtsykun
Copy link
Contributor
@vtsykun vtsykun commented Mar 10, 2023
Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #49638
License MIT
Doc PR -

This issue related to #25928

Step to reproduce

  1. Add parameter like this
parameters:
    banner_message: "\e[37;44m#StandWith\e[30;43mUkraine\e[0m"
  1. Run command debug:router

Actual result:

Selection_1343

@carsonbot carsonbot added this to the 5.4 milestone Mar 10, 2023
@vtsykun vtsykun changed the title Fix support binary values in parameters. [DependencyInjection] Fix support binary values in parameters. Mar 10, 2023
@@ -320,7 +320,7 @@ private function convertParameters(array $parameters, string $type, \DOMElement
$element->setAttribute('type', 'expression');
$text = $this->document->createTextNode(self::phpToXml((string) $value));
$element->appendChild($text);
} elseif (\is_string($value) && !preg_match('/^[^\x00-\x08\x0B\x0E-\x1A\x1C-\x1F\x7F]*+$/u', $value)) {
} elseif (\is_string($value) && !preg_match('/^[^\x00-\x08\x0B\x0C\x0E-\x1F\x7F]*+$/u', $value)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only those chars is valid for XML
0x09 - tab
0x0a - \n
0x0d - \r

@nicolas-grekas
Copy link
Member

Thank you @vtsykun.

@nicolas-grekas nicolas-grekas merged commit 48f806a into symfony:5.4 Mar 10, 2023
@vtsykun vtsykun deleted the fix/xml-dumper branch March 10, 2023 09:46
This was referenced Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0