More psr-2 changes
This commit is contained in:
parent
61e81377cb
commit
1663ef141c
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,15 @@
|
|||
<?php
|
||||
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* PHPExcel
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_HTML
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -26,21 +34,6 @@
|
|||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_HTML
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
|
||||
|
@ -120,12 +113,12 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
{
|
||||
// Reading 2048 bytes should be enough to validate that the format is HTML
|
||||
$data = fread($this->_fileHandle, 2048);
|
||||
if ((strpos($data, '<') !== FALSE) &&
|
||||
if ((strpos($data, '<') !== false) &&
|
||||
(strlen($data) !== strlen(strip_tags($data)))) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,8 +166,9 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
|
||||
protected function _setTableStartColumn($column)
|
||||
{
|
||||
if ($this->_tableLevel == 0)
|
||||
if ($this->_tableLevel == 0) {
|
||||
$column = 'A';
|
||||
}
|
||||
++$this->_tableLevel;
|
||||
$this->_nestedColumn[$this->_tableLevel] = $column;
|
||||
|
||||
|
@ -259,11 +253,13 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
case 'strong':
|
||||
case 'b':
|
||||
// echo 'STYLING, SPAN OR DIV<br />';
|
||||
if ($cellContent > '')
|
||||
if ($cellContent > '') {
|
||||
$cellContent .= ' ';
|
||||
}
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
if ($cellContent > '')
|
||||
if ($cellContent > '') {
|
||||
$cellContent .= ' ';
|
||||
}
|
||||
// echo 'END OF STYLING, SPAN OR DIV<br />';
|
||||
break;
|
||||
case 'hr':
|
||||
|
@ -360,8 +356,9 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
$this->_flushCell($sheet, $column, $row, $cellContent);
|
||||
$column = $this->_setTableStartColumn($column);
|
||||
// echo 'START OF TABLE LEVEL ' , $this->_tableLevel , '<br />';
|
||||
if ($this->_tableLevel > 1)
|
||||
if ($this->_tableLevel > 1) {
|
||||
--$row;
|
||||
}
|
||||
$this->_processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
// echo 'END OF TABLE LEVEL ' , $this->_tableLevel , '<br />';
|
||||
$column = $this->_releaseTableStartColumn();
|
||||
|
@ -476,7 +473,7 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
$dom = new domDocument;
|
||||
// Reload the HTML file into the DOM object
|
||||
$loaded = $dom->loadHTML($this->securityScanFile($pFilename));
|
||||
if ($loaded === FALSE) {
|
||||
if ($loaded === false) {
|
||||
throw new PHPExcel_Reader_Exception('Failed to load ', $pFilename, ' as a DOM Document');
|
||||
}
|
||||
|
||||
|
@ -529,6 +526,4 @@ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
}
|
||||
return $xml;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue