Skip to content

Commit 11b3941

Browse files
author
Bas-Jan 't Jong
committed
Fixed a bug, that when a second header was added to a section, all
images added to the second header were assigned to the first header, resulting in at least a corrupted DOCX.
1 parent ce85cc5 commit 11b3941

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpWord/Element/AbstractContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ private function checkElementDocPart()
355355
$docPart = $isCellTextrun ? $this->getDocPart() : $this->container;
356356
$docPartId = $isCellTextrun ? $this->getDocPartId() : $this->sectionId;
357357
$inHeaderFooter = ($docPart == 'header' || $docPart == 'footer');
358-
358+
$docPartId = $inHeaderFooter ? $this->getDocPartId() : $docPartId;
359359
return $inHeaderFooter ? $docPart . $docPartId : $docPart;
360360
}
361361

0 commit comments

Comments
 (0)