Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some control characters are not replaced and causes corrupted file #45

Open
cerven opened this issue Aug 31, 2021 · 0 comments
Open

Some control characters are not replaced and causes corrupted file #45

cerven opened this issue Aug 31, 2021 · 0 comments

Comments

@cerven
Copy link

cerven commented Aug 31, 2021

In Text.php, buildControlCharacters() constructs array of control characters, but only characters 0 - 19(without 9, 10, 13).

If i create Word2007 file with some other control character, for example 20, generated file is corrupted.

Sample:

$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->addText('control char 27(ESC):' . chr(27));
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('test.docx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant