Skip to content

Improve error messages for XSLTProcessor::transformToDoc() - #12332

Merged
ndossche merged 2 commits into
php:masterfrom
ndossche:xsl-improve-error
Oct 2, 2023
Merged

ndossche merged 2 commits into
php:masterfrom
ndossche:xsl-improve-error

Conversation

@ndossche

Copy link
Copy Markdown
Member

Also adds a relevant test file, as both these branches were untested before.

Also adds a relevant test file, as both these branches were untested before.
Comment thread ext/xsl/xsltprocessor.c Outdated
Comment on lines +576 to +581
ce = zend_lookup_class(ret_class);
if (ce == NULL || !instanceof_function(ce, curce)) {
xmlFreeDoc(newdocp);
if (ce == NULL) {
zend_argument_type_error(2, "must be a valid class");
goto fail;
}
if (!instanceof_function(ce, curce)) {

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.

Can't the C ZPP type specifier be used instead for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TIL, thanks. I've updated this to use C.

@ndossche
ndossche merged commit f88368c into php:master Oct 2, 2023
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