1
0
mirror of https://github.com/shuchkin/simplexlsxgen.git synced 2023-08-10 21:12:59 +03:00

Merge pull request #8 from jturbide/master

Fix invalid content
This commit is contained in:
Sergey Shuchkin 2020-08-28 00:26:29 +06:00 committed by GitHub
commit 476e083f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,13 +216,13 @@ class SimpleXLSXGen {
$cs = 6; // [22] m/d/yy h:mm
} elseif ( mb_strlen( $v ) > 160 ) {
$ct = 'inlineStr';
$cv = str_replace(['&','<','>'],['&amp;','&lt;','&gt;'], $v);
$cv = str_replace(['&','<','>',"\x03"],['&amp;','&lt;','&gt;',''], $v);
} else {
if ( preg_match('/^[0-9+-.]+$/', $v ) ) { // Long ?
$cs = 7; // Align Right
}
$ct = 's'; // shared string
$v = str_replace(['&','<','>'],['&amp;','&lt;','&gt;'], $v);
$v = str_replace(['&','<','>',"\x03"],['&amp;','&lt;','&gt;',''], $v);
$cv = false;
$skey = '~'.$v;
if ( isset($SI_KEYS[ $skey ]) ) {