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 5812a72

Browse filesBrowse files
[Mime] Fix serializing uninitialized RawMessage::$message to null
1 parent a67e8bd commit 5812a72
Copy full SHA for 5812a72

File tree

5 files changed

+14
-9
lines changed
Filter options

5 files changed

+14
-9
lines changed

‎src/Symfony/Component/Mime/RawMessage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/RawMessage.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
class RawMessage implements \Serializable
2020
{
21+
/**
22+
* @var iterable|string
23+
*/
2124
private $message;
2225

2326
/**

‎src/Symfony/Component/Mime/Tests/EmailTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Tests/EmailTest.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,7 @@ public function testSymfonySerialize()
547547
}
548548
]
549549
},
550-
"body": null,
551-
"message": null
550+
"body": null
552551
}
553552
EOF;
554553

‎src/Symfony/Component/Mime/Tests/MessageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Tests/MessageTest.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,7 @@ public function testSymfonySerialize()
254254
]
255255
},
256256
"class": "Symfony\\\\Component\\\\Mime\\\\Part\\\\Multipart\\\\MixedPart"
257-
},
258-
"message": null
257+
}
259258
}
260259
EOF;
261260

‎src/Symfony/Component/Mime/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/composer.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
2929
"symfony/property-access": "^4.4|^5.1|^6.0",
3030
"symfony/property-info": "^4.4|^5.1|^6.0",
31-
"symfony/serializer": "^5.4.26|~6.2.13|^6.3.2"
31+
"symfony/serializer": "^5.4.35|~6.3.12|^6.4.3"
3232
},
3333
"conflict": {
3434
"egulias/email-validator": "~3.0.0",
3535
"phpdocumentor/reflection-docblock": "<3.2.2",
3636
"phpdocumentor/type-resolver": "<1.4.0",
3737
"symfony/mailer": "<4.4",
38-
"symfony/serializer": "<5.4.26|>=6,<6.2.13|>=6.3,<6.3.2"
38+
"symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3"
3939
},
4040
"autoload": {
4141
"psr-4": { "Symfony\\Component\\Mime\\": "" },

‎src/Symfony/Component/Serializer/Normalizer/MimeMessageNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/MimeMessageNormalizer.php
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Mime\Header\UnstructuredHeader;
1818
use Symfony\Component\Mime\Message;
1919
use Symfony\Component\Mime\Part\AbstractPart;
20+
use Symfony\Component\Mime\RawMessage;
2021
use Symfony\Component\Serializer\SerializerAwareInterface;
2122
use Symfony\Component\Serializer\SerializerInterface;
2223

@@ -63,15 +64,18 @@ public function normalize($object, ?string $format = null, array $context = [])
6364
return $ret;
6465
}
6566

67+
$ret = $this->normalizer->normalize($object, $format, $context);
68+
6669
if ($object instanceof AbstractPart) {
67-
$ret = $this->normalizer->normalize($object, $format, $context);
6870
$ret['class'] = \get_class($object);
6971
unset($ret['seekable'], $ret['cid'], $ret['handle']);
72+
}
7073

71-
return $ret;
74+
if ($object instanceof RawMessage && \array_key_exists('message', $ret) && null === $ret['message']) {
75+
unset($ret['message']);
7276
}
7377

74-
return $this->normalizer->normalize($object, $format, $context);
78+
return $ret;
7579
}
7680

7781
/**

0 commit comments

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