Single QUOTE translated to unwanted '
Since PHP8.1
htmlspecialchars default parameters switched from
ENT_COMPAT
to
ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
=> see Changelog ¶
as a result
PhpSpreadsheet Saved with XMLWriter no longger has text with QUOTES but text with '
processing the XLSX file with 'Tiny but Strong' for exemple fails because of wrong syntax due to this new data and semicolon
=> fix is forcing ENT_COMPAT when calling htmlspecialchars in XMLWriter::writeRawData
public function writeRawData($rawTextData)
{
if (is_array($rawTextData)) {
$rawTextData = implode("\n", $rawTextData);
}
return $this->writeRaw(htmlspecialchars($rawTextData, ENT_COMPAT));
}