Skip to content

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

@cerven

Description

@cerven

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions