Skip to content

Commit 7a4fcd6

Browse files
committed
prevent writing raw list tag in different format
1 parent 2f5e4c7 commit 7a4fcd6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tag/ListTag.php

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public function writeContent(Writer $writer): static
2222
{
2323
$writer->getSerializer()->writeByte($this->contentTagType);
2424
if ($this->isRaw()) {
25+
if($this->rawContentFormat !== $writer->getFormat()) {
26+
throw new Exception("Cannot change format of raw list tag");
27+
}
28+
2529
$writer->getSerializer()->writeLengthPrefix($this->rawContentLength);
2630
$writer->write($this->rawContent);
2731
} else {

0 commit comments

Comments
 (0)