Skip to content

Fix GH-25434: C14NFile() skips namespace relinking on success - #25435

Closed
lazerg wants to merge 2 commits into
php:PHP-8.4from
lazerg:fix/gh-25434
Closed

lazerg wants to merge 2 commits into
php:PHP-8.4from
lazerg:fix/gh-25434

Conversation

@lazerg

@lazerg lazerg commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

For modern DOM, dom_canonicalization() takes the xmlns:* attributes off their elements before canonicalizing and puts them back at clean_links. On success, C14NFile() returned early with RETURN_LONG(), so the declarations stayed detached and the links table leaked. It now sets the return value and falls through to the cleanup like C14N() does.

Fixes #25434

@lazerg

lazerg commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

The CircleCI failure is a "No configuration was found" error on the CircleCI side and is not caused by this change.

Comment thread ext/dom/node.c
@@ -2331,7 +2331,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{

bytes = xmlOutputBufferClose(buf);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while at it, checks success and acts accordingly if it fails.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in eb0d34f, C14NFile() now returns false when the close fails instead of the negative error code.

@devnexen devnexen closed this in 73d71aa Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants