Moving bugfixes from 2.3 to 2.4 and updated install languages for Denmark and Sweden.
[fa-stable.git] / reporting / includes / Workbook.php
index 185daefcc3707f6dd2f7c400391c09705e2570ab..718bdb66343e1bec237c5d543d7ce6af309e799f 100644 (file)
@@ -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
         }
     }
 }
-?>