Skip to content

ext/XML: Improve invalid value handling for XML_OPTION_SKIP_TAGSTART#22030

Open
LamentXU123 wants to merge 1 commit into
php:masterfrom
LamentXU123:bug-fix-12
Open

ext/XML: Improve invalid value handling for XML_OPTION_SKIP_TAGSTART#22030
LamentXU123 wants to merge 1 commit into
php:masterfrom
LamentXU123:bug-fix-12

Conversation

@LamentXU123
Copy link
Copy Markdown
Contributor

@LamentXU123 LamentXU123 commented May 13, 2026

cleaning up implicit cast of zval_get_long in XML_OPTION_SKIP_TAGSTART

Types like stdClass or array will cause two warnings currently, which is duplication. For non-numeric string, the original behavior is silently convert it to long (0) and return false with no warning.

So one suggested practice is to check if the type is string|int|bool, if no raise a warning and ret false, if yes than go to zval_try_get_long and see if it is non-numeric string, if yes raise a warning and ret false.

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.

1 participant