X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2FWorkbook.php;h=718bdb66343e1bec237c5d543d7ce6af309e799f;hb=33dfc21a26f08e9ac19048bbcf80cce2351a6cfe;hp=185daefcc3707f6dd2f7c400391c09705e2570ab;hpb=61692f1ac4949f172017fcefc7b191bc7e3d3968;p=fa-stable.git diff --git a/reporting/includes/Workbook.php b/reporting/includes/Workbook.php index 185daefc..718bdb66 100644 --- a/reporting/includes/Workbook.php +++ b/reporting/includes/Workbook.php @@ -102,7 +102,6 @@ define('SPREADSHEET_EXCEL_WRITER_EQ', "="); */ define('SPREADSHEET_EXCEL_WRITER_NE', "<>"); -$encoding_string=''; /** * Class for creating OLE streams for Excel Spreadsheets * @@ -3118,7 +3117,7 @@ class Spreadsheet_Excel_Writer_Parser function _expression() { // If it's a string return a string node - if (ereg("^\"[^\"]{0,255}\"$", $this->_current_token)) { + if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) { $result = $this->_createTree($this->_current_token, '', ''); $this->_advance(); return $result; @@ -4878,11 +4877,10 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr */ function setInputEncoding($encoding) { - global $encoding_string; if ($encoding != 'UTF-16LE' && !function_exists('iconv')) { die("Using an input encoding other than UTF-16LE requires PHP support for iconv"); } - $this->_input_encoding = $encoding_string = $encoding; + $this->_input_encoding = $encoding; } /** added 2009-03-05 by Joe Hunt, FA for arabic languages */ @@ -7744,7 +7742,7 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri /* if ($this->_BIFF_version == 0x0600) // Tried to fix the correct handling here, with the { // corrected specification from M$ - Joe Hunt 2009-03-08 - global $encoding_string; + $encoding_string = $this->_input_encoding; if ($encoding_string == 'UTF-16LE') { $strlen = function_exists('mb_strlen') ? mb_strlen($sheetname, 'UTF-16LE') : (strlen($sheetname) / 2); @@ -8440,4 +8438,3 @@ class Spreadsheet_Excel_Writer_Workbook extends Spreadsheet_Excel_Writer_BIFFwri } } } -?>