This commit is contained in:
Sergey Shuchkin 2021-07-28 22:01:02 +06:00
parent 6d49a90fe7
commit 5b58103e3b
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 1.0.19 (2021-07-28)
* Fixed sheet names duplicates
## 1.0.18 (2021-07-28)
* Fixed email regex

View File

@ -117,6 +117,14 @@ class SimpleXLSXGen {
public function addSheet( array $rows, $name = null ) {
$this->curSheet++;
if ( $name !== null ) {
foreach( $this->sheets as $sh ) {
if ( $name === $sh['name'] ) {
$name .= ' ' . mt_rand( 100000, 999999 );
}
}
}
$this->sheets[$this->curSheet] = ['name' => $name ?: 'Sheet'.($this->curSheet+1), 'hyperlinks' => []];
if ( is_array( $rows ) && isset( $rows[0] ) && is_array($rows[0]) ) {