33    define(
'PHPEXCEL_ROOT', dirname(__FILE__) . 
'/../../');
 
   34    require(PHPEXCEL_ROOT . 
'PHPExcel/Autoloader.php');
 
   67        'h1' => array(
'font' => array(
'bold' => 
true,
 
   71        'h2' => array(
'font' => array(
'bold' => 
true,
 
   75        'h3' => array(
'font' => array(
'bold' => 
true,
 
   79        'h4' => array(
'font' => array(
'bold' => 
true,
 
   83        'h5' => array(
'font' => array(
'bold' => 
true,
 
   87        'h6' => array(
'font' => array(
'bold' => 
true,
 
   91        'a' => array(
'font' => array(
'underline' => 
true,
 
  122        $data = fread($this->_fileHandle, 2048);
 
  123        if ((strpos(
$data, 
'<') !== FALSE) &&
 
  124                (strlen(
$data) !== strlen(strip_tags(
$data)))) {
 
  138    public function load($pFilename)
 
  154        $this->_inputEncoding = $pValue;
 
  176        if ($this->_tableLevel == 0)
 
  193        return array_pop($this->_nestedColumn);
 
  198        if (is_string($cellContent)) {
 
  200            if (trim($cellContent) > 
'') {
 
  205                $sheet->setCellValue(
$column . 
$row, $cellContent, 
true);
 
  211            $this->_dataArray[
$row][
$column] = 
'RICH TEXT: ' . $cellContent;
 
  213        $cellContent = (string) 
'';
 
  218        foreach ($element->childNodes as $child) {
 
  219            if ($child instanceof DOMText) {
 
  220                $domText = preg_replace(
'/\s+/u', 
' ', trim($child->nodeValue));
 
  221                if (is_string($cellContent)) {
 
  223                    $cellContent .= $domText;
 
  228            } elseif ($child instanceof DOMElement) {
 
  231                $attributeArray = array();
 
  232                foreach ($child->attributes as $attribute) {
 
  234                    $attributeArray[$attribute->name] = $attribute->value;
 
  237                switch ($child->nodeName) {
 
  239                        foreach ($attributeArray as $attributeName => $attributeValue) {
 
  240                            switch ($attributeName) {
 
  251                        $sheet->setTitle($cellContent);
 
  262                        if ($cellContent > 
'')
 
  265                        if ($cellContent > 
'')
 
  272                        if (isset($this->_formats[$child->nodeName])) {
 
  273                            $sheet->getStyle(
$column . 
$row)->applyFromArray($this->_formats[$child->nodeName]);
 
  275                            $cellContent = 
'----------';
 
  280                        if ($this->_tableLevel > 0) {
 
  282                            $cellContent .= 
"\n";
 
  292                        foreach ($attributeArray as $attributeName => $attributeValue) {
 
  293                            switch ($attributeName) {
 
  296                                    $sheet->getCell(
$column . 
$row)->getHyperlink()->setUrl($attributeValue);
 
  297                                    if (isset($this->_formats[$child->nodeName])) {
 
  298                                        $sheet->getStyle(
$column . 
$row)->applyFromArray($this->_formats[$child->nodeName]);
 
  316                        if ($this->_tableLevel > 0) {
 
  318                            $cellContent .= 
"\n";
 
  323                            if ($cellContent > 
'') {
 
  332                            if (isset($this->_formats[$child->nodeName])) {
 
  333                                $sheet->getStyle(
$column . 
$row)->applyFromArray($this->_formats[$child->nodeName]);
 
  341                        if ($this->_tableLevel > 0) {
 
  343                            $cellContent .= 
"\n";
 
  348                            if ($cellContent > 
'') {
 
  363                        if ($this->_tableLevel > 1)
 
  368                        if ($this->_tableLevel > 1) {
 
  406                        if (isset($attributeArray[
'rowspan']) && isset($attributeArray[
'colspan'])) {
 
  409                            for (
$i = 0; 
$i < $attributeArray[
'colspan'] - 1; 
$i++) {
 
  412                            $range = 
$column . 
$row . 
':' . $columnTo . (
$row + $attributeArray[
'rowspan'] - 1);
 
  414                                $this->rowspan[$value] = 
true;
 
  416                            $sheet->mergeCells($range);
 
  418                        } elseif (isset($attributeArray[
'rowspan'])) {
 
  422                                $this->rowspan[$value] = 
true;
 
  424                            $sheet->mergeCells($range);
 
  425                        } elseif (isset($attributeArray[
'colspan'])) {
 
  428                            for (
$i = 0; 
$i < $attributeArray[
'colspan'] - 1; 
$i++) {
 
  440                        $this->_tableLevel = 0;
 
  463            fclose($this->_fileHandle);
 
  467        fclose($this->_fileHandle);
 
  470        while (
$objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
 
  476        $dom = 
new domDocument;
 
  479        if ($loaded === FALSE) {
 
  484        $dom->preserveWhiteSpace = 
false;
 
  513        $this->_sheetIndex = $pValue;
 
  526        $pattern = 
'/\\0?' . implode(
'\\0?', str_split(
'<!ENTITY')) . 
'\\0?/';
 
  527        if (preg_match($pattern, 
$xml)) { 
 
  528            throw new PHPExcel_Reader_Exception(
'Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
 
An exception for terminatinating execution or to throw for unit testing.
static extractAllCellReferencesInRange($pRange='A1')
Extract all cell references in range.
securityScanFile($filestream)
Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.
_openFile($pFilename)
Open file for reading.
_isValidFormat()
Validate that the current file is an HTML file.
load($pFilename)
Loads PHPExcel from file.
securityScan($xml)
Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.
loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
Loads PHPExcel from file into PHPExcel instance.
_processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent, $format=null)
setSheetIndex($pValue=0)
Set sheet index.
__construct()
Create a new PHPExcel_Reader_HTML.
setInputEncoding($pValue='ANSI')
Set input encoding.
_setTableStartColumn($column)
getSheetIndex()
Get sheet index.
_releaseTableStartColumn()
_flushCell($sheet, $column, $row, &$cellContent)
getInputEncoding()
Get input encoding.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'