diff --git a/Classes/PHPExcel/IOFactory.php b/Classes/PHPExcel/IOFactory.php index 30762c1b..cd7bbf91 100644 --- a/Classes/PHPExcel/IOFactory.php +++ b/Classes/PHPExcel/IOFactory.php @@ -223,6 +223,7 @@ class PHPExcel_IOFactory // First, lucky guess by inspecting file extension $pathinfo = pathinfo($pFilename); + $extensionType = NULL; if (isset($pathinfo['extension'])) { switch (strtolower($pathinfo['extension'])) { case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet @@ -261,19 +262,20 @@ class PHPExcel_IOFactory break; } - $reader = self::createReader($extensionType); - // Let's see if we are lucky - if (isset($reader) && $reader->canRead($pFilename)) { - return $reader; + if ($extensionType !== NULL) { + $reader = self::createReader($extensionType); + // Let's see if we are lucky + if (isset($reader) && $reader->canRead($pFilename)) { + return $reader; + } } - } // If we reach here then "lucky guess" didn't give any result // Try walking through all the options in self::$_autoResolveClasses foreach (self::$_autoResolveClasses as $autoResolveClass) { // Ignore our original guess, we know that won't work - if ($reader !== $extensionType) { + if ($autoResolveClass !== $extensionType) { $reader = self::createReader($autoResolveClass); if ($reader->canRead($pFilename)) { return $reader; @@ -281,6 +283,6 @@ class PHPExcel_IOFactory } } - throw new Exception('Unable to identify a reader for this file'); + throw new Exception('Unable to identify a reader for this file'); } // function createReaderForFile() } diff --git a/changelog.txt b/changelog.txt index 845d93fc..514a52db 100644 --- a/changelog.txt +++ b/changelog.txt @@ -105,6 +105,7 @@ Fixed in develop branch: - Bugfix: (MBaker) Work item 18146 - Chart Refresh returning cell reference rather than values - Bugfix: (MBaker) Work item 18145 - Autoshape being identified in twoCellAnchor when includeCharts is TRUE triggering load error - Bugfix: (MBaker) Work item 18325 - v-type texts for series labels now recognised and parsed correctly +- Bugfix: (wolf5x) Work item 18492 - load file failed if the file has no extensionType 2012-05-19 (v1.7.7):