Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[VarDumper] Fix error with uninitialized XMLReader#43413

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.4fromvillfa:fix/42581
Oct 14, 2021
Merged

[VarDumper] Fix error with uninitialized XMLReader#43413

fabpot merged 1 commit intosymfony:4.4fromvillfa:fix/42581
Oct 14, 2021

Conversation

@villfa
Copy link
Contributor

@villfavillfa commentedOct 12, 2021
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#42581
LicenseMIT
Doc PRn/a

When XMLReader is not initialized, getParserProperty() throws an error (or emits a warning, depending on the PHP version).
Now the error is caught and the properties are set to false.

@carsonbot
Copy link

Hey!

I think@fancyweb has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@villfa
Copy link
ContributorAuthor

Hi@fabpot,
The error fromfabbot.io is a false positive, so I'm wondering if the code of this bot is open in order to fix it.
Or maybe it relies on open tools?

'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE),
'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
];
}catch (Error$e) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
}catch (Error$e) {
}catch (\ValueError$e) {

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I've usedError instead ofValueError on purpose because of this fix in PHP:php/php-src@53f8921

derrabus and ging-dev reacted with thumbs up emoji
Copy link
Member

@derrabusderrabusOct 13, 2021
edited
Loading

Choose a reason for hiding this comment

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

That makes total sense. I can confirm that anError is triggered on the latest PHP snapshot.

That makes me wonder: Is there a better way to detect an uninitializedXMLReader than to catch a genericError?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I've double-checked the XMLReaderdocumentation andsource code, and I couldn't find another way to check if an instance is not yet initialized :(

@derrabus
Copy link
Member

Thank you for your PR,@villfa. The open source tool that fabbot relies on is PHP CS Fixer. Since the failure is a false positive as you already discovered, you can simply ignore it. 🙂

villfa reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@villfa.

@fabpotfabpot merged commit049e641 intosymfony:4.4Oct 14, 2021
@villfavillfa deleted the fix/42581 branchOctober 14, 2021 07:54
This was referencedOct 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@villfa@carsonbot@derrabus@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp