To prevent third-party libs which use PhpSpreadsheet from failing on warnings, I think there needs to be a modification to suppress parse warnings either permanently or via a flag
_phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php:546_
$dom = new DOMDocument();
// Reload the HTML file into the DOM object
$internalErrors = libxml_use_internal_errors(true);
$loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanFile($pFilename), 'HTML-ENTITIES', 'UTF-8'));
libxml_use_internal_errors($internalErrors);
if ($loaded === false) {
throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document');
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
Why nothing was changed? There is still problem with HtmlLoading and its failing because of it.
Yes, that's still a problem. I'm wondering why not more people have this issue!?
when i upgrade laravel 5.8 to 6.0, i had got same error
DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 19
public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{
// Validate
if (!$this->canRead($pFilename)) {
throw new Exception($pFilename . ' is an Invalid HTML file.');
}
// Create a new DOM object
$dom = new DOMDocument();
// Reload the HTML file into the DOM object
$loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanner->scanFile($pFilename), 'HTML-ENTITIES', 'UTF-8'));
if ($loaded === false) {
throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document');
}
return $this->loadDocument($dom, $spreadsheet);
}
/**
* Spreadsheet from content.
*
* @param string $content
Most helpful comment
Why nothing was changed? There is still problem with HtmlLoading and its failing because of it.