Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit72a3ad5

Browse files
committed
bug#47455 [Mime] Fix TextPart broken after being serialized (fabpot)
This PR was merged into the 5.4 branch.Discussion----------[Mime] Fix TextPart broken after being serialized| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->| License | MIT| Doc PR | n/aWhen serializing a TextPart, it's broken as we change the body to a string but we don't reset the seekable property (this property was introduced in 5.4).Commits-------a1a1609 [Mime] Fix TextPart broken after being serialized
2 parentsc61dfca +a1a1609 commit72a3ad5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎src/Symfony/Component/Mime/Part/TextPart.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ public function __sleep()
197197
// convert resources to strings for serialization
198198
if (null !==$this->seekable) {
199199
$this->body =$this->getBody();
200+
$this->seekable =null;
200201
}
201202

202203
$this->_headers =$this->getHeaders();

‎src/Symfony/Component/Mime/Tests/Part/TextPartTest.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public function testSerialize()
8787
$p =newTextPart($r);
8888
$p->getHeaders()->addTextHeader('foo','bar');
8989
$expected =clone$p;
90-
$this->assertEquals($expected->toString(),unserialize(serialize($p))->toString());
90+
$n =unserialize(serialize($p));
91+
$this->assertEquals($expected->toString(),$p->toString());
92+
$this->assertEquals($expected->toString(),$n->toString());
9193
}
9294
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp