-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Hi,
I'm trying to create a doc:
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $content);
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('...');
where $content contains a string with a "&".
I get this error:
Warning: DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity, line: 1 in PhpOffice/PhpWord/Shared/Html.php on line 55
Notice: Trying to get property of non-object in PhpOffice/PhpWord/Shared/Html.php on line 129
Notice: Trying to get property of non-object in PhpOffice/PhpWord/Shared/Html.php on line 169
Notice: Trying to get property of non-object in PhpOffice/PhpWord/Shared/Html.php on line 170
I've tried to replace the & by & but same error. If I remove it, no problem.
I'm using the last version of PHPWord.
Thank you