Fix sheet name escaping
Sheet names are stored as attributes of an XML entity. We therefore need a different escaping strategy, escaping quotes.
This commit is contained in:
1 parent
ee998f7173
commit
71cf0fe339
6 files changed
+12
-13
No files matched your search
@@ -45,9 +45,9 @@ class XLSX implements EscaperInterface
|
||||
$this->initIfNeeded();
|
||||
|
||||
$escapedString = $this->escapeControlCharacters($string);
|
||||
// @NOTE: Using ENT_NOQUOTES as only XML entities ('<', '>', '&') need to be encoded.
|
||||
// Single and double quotes can be left as is.
|
||||
$escapedString = htmlspecialchars($escapedString, ENT_NOQUOTES);
|
||||
// @NOTE: Using ENT_QUOTES as XML entities ('<', '>', '&') as well as
|
||||
// single/double quotes (for XML attributes) need to be encoded.
|
||||
$escapedString = htmlspecialchars($escapedString, ENT_QUOTES);
|
||||
|
||||
return $escapedString;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user