mirror of
https://github.com/shuchkin/simplexlsxgen.git
synced 2023-08-10 21:12:59 +03:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
6d49a90fe7 | |||
c8a94d552a | |||
c9fa7da689 | |||
0d059fdf6e | |||
dcb5f8ad65 |
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.18 (2021-07-28)
|
||||
|
||||
* Fixed email regex
|
||||
|
||||
## 1.0.17 (2021-07-28)
|
||||
|
||||
* Fixed " and & in sheets names
|
||||
|
||||
## 1.0.16 (2021-07-01)
|
||||
|
||||
* Fixed "&" in hyperlinks
|
||||
|
||||
## 1.0.15 (2021-06-22)
|
||||
|
||||
* Fixed *mailto* hyperlinks detection
|
||||
|
||||
## 1.0.14 (2021-06-08)
|
||||
|
||||
* Added *mailto* hyperlinks support (thx Howard Martin)
|
||||
|
@ -217,7 +217,7 @@ class SimpleXLSXGen {
|
||||
} elseif ( $cfilename === 'xl/workbook.xml' ) {
|
||||
$s = '';
|
||||
foreach ( $this->sheets as $k => $v ) {
|
||||
$s .= '<sheet name="' . $v['name'] . '" sheetId="' . ( $k + 1) . '" state="visible" r:id="rId' . ( $k + 2) . '"/>';
|
||||
$s .= '<sheet name="' . $this->esc( $v['name'] ) . '" sheetId="' . ( $k + 1) . '" state="visible" r:id="rId' . ( $k + 2) . '"/>';
|
||||
}
|
||||
$template = str_replace('{SHEETS}', $s, $template);
|
||||
$this->_writeEntry($fh, $cdrec, $cfilename, $template);
|
||||
@ -250,7 +250,7 @@ class SimpleXLSXGen {
|
||||
$RH = [];
|
||||
$filename = 'xl/worksheets/_rels/sheet' . ( $k + 1 ) . '.xml.rels';
|
||||
foreach ( $v['hyperlinks'] as $h ) {
|
||||
$RH[] = '<Relationship Id="' . $h['ID'] . '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="' . $h['H'] . '" TargetMode="External"/>';
|
||||
$RH[] = '<Relationship Id="' . $h['ID'] . '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="' . $this->esc($h['H']) . '" TargetMode="External"/>';
|
||||
}
|
||||
$xml = str_replace( '{HYPERLINKS}', implode( "\r\n", $RH ), $template );
|
||||
$this->_writeEntry( $fh, $cdrec, $filename, $xml );
|
||||
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user