Skip to content

Commit

Permalink
prevent writing raw list tag in different format
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtThiemann committed Apr 5, 2023
1 parent 2f5e4c7 commit 7a4fcd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Tag/ListTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function writeContent(Writer $writer): static
{
$writer->getSerializer()->writeByte($this->contentTagType);
if ($this->isRaw()) {
if($this->rawContentFormat !== $writer->getFormat()) {
throw new Exception("Cannot change format of raw list tag");
}

$writer->getSerializer()->writeLengthPrefix($this->rawContentLength);
$writer->write($this->rawContent);
} else {
Expand Down

0 comments on commit 7a4fcd6

Please sign in to comment.