Suppress Libxml Warnings in Reader/Html#4761
Merged
oleibman merged 3 commits intoPHPOffice:masterfrom Dec 29, 2025
Merged
Conversation
Fix PHPOffice#647, which went stale in 2019 and is now reopened. Fix PHPOffice#849, which went stale in 2019 and is now reopened. Html Reader currently echoes any warning messages from Dom::loadHtml when it parses Html input. These are generally not needed, and may cause PhpSpreadsheet to fail needlessly. A new property `$suppressLoadWarnings` is added. It will additionally default to `null`, which will avoid any BC breaks. However, the default will be changed to `true` in a future release. Should the caller be interested in any messages which are suppressed when `true` is in effect, these are available through new method `getLibxmlMessages` after the Html has been loaded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #647, which went stale in 2019 and is now reopened.
Fix #849, which went stale in 2019 and is now reopened.
Html Reader currently echoes any warning messages from Dom::loadHtml when it parses Html input. These are generally not needed, and may cause PhpSpreadsheet to fail needlessly. A new property
$suppressLoadWarningsis added. It will initially default tonull, which will avoid any BC breaks. However, the default will be changed totruein a future release. Should the caller be interested in any messages which are suppressed whentrueis in effect, these are available through new methodgetLibxmlMessagesafter the Html has been loaded.This is:
Checklist: