This commit is contained in:
Sergey Shuchkin 2021-07-28 05:06:23 +06:00
parent c8a94d552a
commit 6d49a90fe7
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 1.0.18 (2021-07-28)
* Fixed email regex
## 1.0.17 (2021-07-28)
* Fixed " and & in sheets names

View File

@ -504,7 +504,7 @@ class SimpleXLSXGen {
$h = explode( '#', $v );
$this->sheets[ $idx ]['hyperlinks'][] = ['ID' => 'rId' . ( count( $this->sheets[ $idx ]['hyperlinks'] ) + 1 ), 'R' => $cname, 'H' => $h[0], 'L' => isset( $h[1] ) ? $h[1] : ''];
$F = self::F_HYPERLINK; // Hyperlink
} elseif ( preg_match( "/^([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)$/i", $v ) ) {
} elseif ( preg_match( "/^[a-zA-Z0-9_\.\-]+@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/", $v ) ) {
$this->sheets[ $idx ]['hyperlinks'][] = ['ID' => 'rId' . ( count( $this->sheets[ $idx ]['hyperlinks'] ) + 1 ), 'R' => $cname, 'H' => 'mailto:' . $v, 'L' => ''];
$F = self::F_HYPERLINK; // Hyperlink
}