Update SimpleXLSXGen.php

Removing special characters known to me from the sheet name. Since if you do not delete these characters, then Excel says that the sheet is broken and offers to restore it.
This commit is contained in:
Oleg Kosarev 2023-04-19 20:17:36 -05:00
parent e0bf379eaa
commit 7a573ef659
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class SimpleXLSXGen
if ($name === null) { // autogenerated sheet names
$name = 'Sheet' . ($this->curSheet + 1);
} else {
$name = mb_substr($name, 0, 31);
$name = mb_substr(str_replace(["/", "*", "/", "|", "\\", "[", "]", ":"], '', $name), 0, 31);
$names = [];
foreach ($this->sheets as $sh) {
$names[mb_strtoupper($sh['name'])] = 1;