Skip to content

[ErrorHandler] fix handling messages with null bytes from anonymous classes #40065

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

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

PHP truncates error messages at null bytes before calling userland error handlers (known behavior in PHP, marked as "won't fix".)

This doesn't play well with anonymous classes.

This PR works around the issue by getting the message from the stack trace.

@carsonbot
Copy link

Hey!

Two days ago, I was sitting at my usual spot at the top of Big Ben, I was thinking that we really needed this. And now, here you are with a PR. =)

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

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas merged commit 6ce4d38 into symfony:4.4 Feb 4, 2021
@nicolas-grekas nicolas-grekas deleted the eh-null-fix branch February 5, 2021 15:41
This was referenced Mar 4, 2021
nicolas-grekas added a commit that referenced this pull request Feb 22, 2024
… classes on PHP >= 8.3.3 (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Follows php/php-src#13153 and #40065

Commits
-------

699f400 [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3
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