Merge pull request #40 from qpautrat/fix-file-exist

Fix condition on existing file
This commit is contained in:
Mark Baker 2012-09-05 17:12:30 -07:00
commit 9820b46649
1 changed files with 4 additions and 0 deletions

View File

@ -442,6 +442,10 @@ class PHPExcel_Reader_HTML implements PHPExcel_Reader_IReader
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
if (!is_file($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! The given file is not a regular file.");
}
// Create new PHPExcel // Create new PHPExcel
while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) { while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
$objPHPExcel->createSheet(); $objPHPExcel->createSheet();