Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2e372d

Browse filesBrowse files
committed
bug #52332 [Yaml] Fix deprecated passing null to trim() (javaDeveloperKid)
This PR was merged into the 5.4 branch. Discussion ---------- [Yaml] Fix deprecated passing null to trim() | Q | A | ------------- | --- | Branch? |5.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Closes #52326 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT Commits ------- 54fc3c5 Fix passing null to trim()
2 parents 9976f9c + 54fc3c5 commit b2e372d
Copy full SHA for b2e372d

File tree

2 files changed

+5
-0
lines changed
Filter options

2 files changed

+5
-0
lines changed

‎src/Symfony/Component/Yaml/Inline.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Inline.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri
6060
*/
6161
public static function parse(string $value = null, int $flags = 0, array &$references = [])
6262
{
63+
if (null === $value) {
64+
return '';
65+
}
66+
6367
self::initialize($flags);
6468

6569
$value = trim($value);

‎src/Symfony/Component/Yaml/Tests/InlineTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/InlineTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ public static function getTestsForParse()
288288
{
289289
return [
290290
['', ''],
291+
[null, ''],
291292
['null', null],
292293
['false', false],
293294
['true', true],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.