You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is "&" in the string it breaks the word document.
Expected behavior
It should not break.
Steps to reproduce
$phpWord = new PhpWord();
// Add a new section to the document
$section = $phpWord->addSection();
// Add text to the section
$section->addText('this is H&M');
$wordFilePath = '/temp/myword.docx'
// Create a temporary file in memory
$objWriter = IOFactory::createWriter($phpWord);
$objWriter->save($wordFilePath);
Now if you try to open the file it throws an error. But if you remove '&' from about string then it works.
PHPWord version(s) where the bug happened
1.2
PHP version(s) where the bug happened
8.1
Priority
I want to crowdfund the bug fix (with @algora-io) and fund a community developer.
I want to pay the bug fix and fund a maintainer for that. (Contact @Progi1984)
The text was updated successfully, but these errors were encountered:
Describe the bug and add attachments
If there is "&" in the string it breaks the word document.

Expected behavior
It should not break.
Steps to reproduce
Now if you try to open the file it throws an error. But if you remove '&' from about string then it works.
PHPWord version(s) where the bug happened
1.2
PHP version(s) where the bug happened
8.1
Priority
The text was updated successfully, but these errors were encountered: