-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw DomException for DOM out-of-memory error conditions
A number of error conditions in DOM can only occur if libxml2 runs out of memory, at least as far as I can see. In such cases we currently do a silent "return false", which violates the DOM spec, and which code is very unlikely to handle sensibly. Switch these to throw a DomException with INVALID_STATE_ERR type. This error type is chosen because we use for similar checks elsewhere, for example: https://github.com/php/php-src/blob/a733b1ada7895f6fa5e349755a878cae9189e3f5/ext/dom/documentfragment.c#L45-L48 This changes some of the more obvious cases I spotted, but there are probably more. Closes GH-7049.
- Loading branch information
Showing
3 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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