diff --git a/Classes/PHPExcel/Shared/String.php b/Classes/PHPExcel/Shared/String.php index cee3ea4..5f59685 100644 --- a/Classes/PHPExcel/Shared/String.php +++ b/Classes/PHPExcel/Shared/String.php @@ -493,14 +493,13 @@ class PHPExcel_Shared_String public static function ConvertEncoding($value, $to, $from) { if (self::getIsIconvEnabled()) { - $value = iconv($from, $to, $value); - return $value; + return iconv($from, $to, $value); } if (self::getIsMbstringEnabled()) { - $value = mb_convert_encoding($value, $to, $from); - return $value; + return mb_convert_encoding($value, $to, $from); } + if($from == 'UTF-16LE'){ return self::utf16_decode($value, false); }else if($from == 'UTF-16BE'){ diff --git a/Classes/PHPExcel/Writer/Excel5/Parser.php b/Classes/PHPExcel/Writer/Excel5/Parser.php index 2210db4..baf7408 100644 --- a/Classes/PHPExcel/Writer/Excel5/Parser.php +++ b/Classes/PHPExcel/Writer/Excel5/Parser.php @@ -944,9 +944,8 @@ class PHPExcel_Writer_Excel5_Parser if ($col >= 256) { throw new Exception("Column in: $cell greater than 255"); } - // FIXME: change for BIFF8 - if ($row >= 16384) { - throw new Exception("Row in: $cell greater than 16384 "); + if ($row >= 65536) { + throw new Exception("Row in: $cell greater than 65536 "); } // Set the high bits to indicate if row or col are relative. @@ -980,11 +979,11 @@ class PHPExcel_Writer_Excel5_Parser --$row2; // Trick poor inocent Excel $col1 = 0; - $col2 = 16383; // FIXME: maximum possible value for Excel 5 (change this!!!) + $col2 = 65535; // FIXME: maximum possible value for Excel 5 (change this!!!) // FIXME: this changes for BIFF8 - if (($row1 >= 16384) or ($row2 >= 16384)) { - throw new Exception("Row in: $range greater than 16384 "); + if (($row1 >= 65536) or ($row2 >= 65536)) { + throw new Exception("Row in: $range greater than 65536 "); } // Set the high bits to indicate if rows are relative. diff --git a/Classes/PHPExcel/Writer/Excel5/Workbook.php b/Classes/PHPExcel/Writer/Excel5/Workbook.php index fb0a67c..99d24d3 100644 --- a/Classes/PHPExcel/Writer/Excel5/Workbook.php +++ b/Classes/PHPExcel/Writer/Excel5/Workbook.php @@ -629,7 +629,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter $rowmax = $repeat[1] - 1; } else { $rowmin = 0; - $rowmax = 16383; + $rowmax = 65535; } $this->_writeNameShort( diff --git a/changelog.txt b/changelog.txt index ffca13a..f00fd78 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,6 +26,7 @@ Fixed in develop branch: - Bugfix: (Asker) Work item 18777 - Error in PHPEXCEL/Calculation.php script on line 2976 (stack pop check) - Bugfix: (MBaker) Work item 18794 - CSV files without a file extension being identified as HTML +- Bugfix: (MBaker) Work item GH-66 - Wrong check for maximum number of rows in Excel5 Writer --------------------------------------------------------------------------------