Closed
Description
I'm using the template stuff in order to replace some values, but the following code breaks the template (anything in the template after the &
symbol is not shown):
$document = $PHPWord->loadTemplate($templatePath);
$document->setValue('type', "some value & foobar");
I guess the &
is a specific character in xml word files, like it can be in html
The workaround I'm currently using is to wrap the value into an htmlspecialchars
and all is ok afterwards:
$document = $PHPWord->loadTemplate($templatePath);
$document->setValue('type', htmlspecialchars("some value & foobar"));
=> why not add this htmlspecialchars
right into the setValue
function ?
Thanks for your feedback