You are here

protected function PHPExcel_Reader_HTML::_isValidFormat in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/HTML.php \PHPExcel_Reader_HTML::_isValidFormat()

Validate that the current file is an HTML file

Return value

boolean

1 call to PHPExcel_Reader_HTML::_isValidFormat()
PHPExcel_Reader_HTML::loadIntoExisting in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/HTML.php
Loads PHPExcel from file into PHPExcel instance

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/HTML.php, line 119

Class

PHPExcel_Reader_HTML
PHPExcel_Reader_HTML

Code

protected function _isValidFormat() {

  //	Reading 2048 bytes should be enough to validate that the format is HTML
  $data = fread($this->_fileHandle, 2048);
  if (strpos($data, '<') !== FALSE && strlen($data) !== strlen(strip_tags($data))) {
    return TRUE;
  }
  return FALSE;
}