From dcb5f8ad65f288e51fe41f6dd1399db66a91c184 Mon Sep 17 00:00:00 2001 From: Sergey Shuchkin Date: Tue, 22 Jun 2021 00:57:29 +0600 Subject: [PATCH] 1.0.15 --- CHANGELOG.md | 4 ++++ src/SimpleXLSXGen.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f33a5e4..418a5c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.15 (2021-06-22) + +* Fixed *mailto* hyperlinks detection + ## 1.0.14 (2021-06-08) * Added *mailto* hyperlinks support (thx Howard Martin) diff --git a/src/SimpleXLSXGen.php b/src/SimpleXLSXGen.php index b871dd3..6132d44 100644 --- a/src/SimpleXLSXGen.php +++ b/src/SimpleXLSXGen.php @@ -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\-\.]*)$/i", $v ) ) { $this->sheets[ $idx ]['hyperlinks'][] = ['ID' => 'rId' . ( count( $this->sheets[ $idx ]['hyperlinks'] ) + 1 ), 'R' => $cname, 'H' => 'mailto:' . $v, 'L' => '']; $F = self::F_HYPERLINK; // Hyperlink }