-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Allow binary values in parameters. #25928
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -511,6 +511,12 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase = | |
} | ||
$arguments[$key] = new TaggedIteratorArgument($arg->getAttribute('tag')); | ||
break; | ||
case 'binary': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It this really legitimate? I mean: if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked for a way to indicate in a XML file (which should be a valid UTF-8 file) that a value was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO using the same term here is legitimate. I would keep it as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, sorry, I misread the code, all good here |
||
if (false === $value = base64_decode($arg->nodeValue)) { | ||
throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="binary" is not a valid base64 encoded string.', $name)); | ||
} | ||
$arguments[$key] = $value; | ||
break; | ||
case 'string': | ||
$arguments[$key] = $arg->nodeValue; | ||
break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the
u
modifier here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, to ensure string is a valid UTF8 string for XML file.