-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH-17847: xinclude destroys live node #17878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dom_xinclude_strip_fallback_references() now also takes into account xi:include nodes children. This now subsumes all work done normally by the old start/end node removal, so we can remove that code and start using XML_PARSE_NOXINCNODE.
ext/dom/document.c
Outdated
* and remove the original nodes. If the originals are removed while there are still userland references | ||
* this will cause memory corruption. */ | ||
static void dom_xinclude_strip_fallback_references(const xmlNode *basep) | ||
static void dom_xinclude_strip_fallback_references(xmlDocPtr docp, const xmlNode *basep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the docPtr necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover from when I was playing around with this. Dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see anything wrong now, so if CI is green feel free to merge.
Also for future reference: the existing code to remove the xinclude start/end nodes wasn't right anyway as it only looked at the top level AFAICT |
Ah great, CI is red on some instances because libxml error messages are not consistent between versions :( |
Win CI is unrelated. |
dom_xinclude_strip_fallback_references() now also takes into account xi:include nodes children. This now subsumes all work done normally by the old start/end node removal, so we can remove that code and start using XML_PARSE_NOXINCNODE. Closes phpGH-17878.
dom_xinclude_strip_fallback_references() now also takes into account xi:include nodes children. This now subsumes all work done normally by the old start/end node removal, so we can remove that code and start using XML_PARSE_NOXINCNODE.