Skip to content
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

DOMDocument::loadXML() should reject empty strings #7039

Closed
weirdan opened this issue Dec 1, 2021 · 1 comment · Fixed by #7407
Closed

DOMDocument::loadXML() should reject empty strings #7039

weirdan opened this issue Dec 1, 2021 · 1 comment · Fixed by #7407

Comments

@weirdan
Copy link
Collaborator

weirdan commented Dec 1, 2021

We should probably annotate $source as non-empty-string so that Psalm would be able to catch it too.

Originally posted by @weirdan in #7036 (comment)

https://3v4l.org/en00b

https://psalm.dev/r/4bb02d8813

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/4bb02d8813
<?php

$d = new DOMDocument;
$d->loadXML(''); // expected Psalm to warn about parameter accepting non-empty-string only
Psalm output (using commit d7d4b37):

No issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant