-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix bug #50989 add support LIBXML_NOXMLDECL for DOMDocument::saveXML() #1897
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
xmlSaveNoEmptyTags = saveempty; | ||
} | ||
if (!size) { | ||
if(xmlSaveDoc(xscp, docp) < 0) { | ||
RETURN_FALSE; |
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.
Leaks the buf (in all Return cases above)
php_error_docref(NULL, E_WARNING, "Could not fetch buffer"); | ||
RETURN_FALSE; | ||
} | ||
xmlSaveCtxtPtr xscp = xmlSaveToBuffer(buf, docp->encoding, options); |
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.
C89 doesn't allow mixing declarations and statements, so please move the declaration up to the start of the block.
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.
fixed.
@jhdxr fix conflicts please :) |
# Conflicts: # ext/dom/document.c
@krakjoe I have merged master and resolved the conflicts, however it seems the master branch is broken for now, so the ci fails. I'll check it later. |
@jhdxr bump, status please ? |
@krakjoe done :) |
Not able to apply:
|
The original implement use
xmlDocDumpFormatMemory
which does not supportXML_SAVE_NO_DECL
, so I replace them with xmlsave api.