mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 12:07:56 +00:00
check HTML syntax on files starting with a BOM
This commit is contained in:
@@ -147,10 +147,8 @@ class Html extends BaseReader
|
||||
return false;
|
||||
}
|
||||
|
||||
$beginning = $this->readBeginning();
|
||||
if (preg_match(self::STARTS_WITH_BOM, $beginning)) {
|
||||
return true;
|
||||
}
|
||||
$beginning = preg_replace(self::STARTS_WITH_BOM, '', $this->readBeginning()) ?? '';
|
||||
|
||||
$startWithTag = self::startsWithTag($beginning);
|
||||
$containsTags = self::containsTags($beginning);
|
||||
$endsWithTag = self::endsWithTag($this->readEnding());
|
||||
|
||||
@@ -102,6 +102,7 @@ class IOFactoryTest extends TestCase
|
||||
// Following not readable by Excel.
|
||||
//['samples/templates/Excel2003XMLTest.xml', 'Xml', Reader\Xml::class],
|
||||
['samples/templates/46readHtml.html', 'Html', Reader\Html::class],
|
||||
['tests/data/Reader/CSV/encoding.utf8bom.csv', 'Csv', Reader\Csv::class],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user