-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix GH-20370: forbid user stream filters to violate typed property constraints #20373
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
base: PHP-8.3
Are you sure you want to change the base?
Fix GH-20370: forbid user stream filters to violate typed property constraints #20373
Conversation
b0808ce to
786ad32
Compare
786ad32 to
2ad8c64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a phone , so can't check. But you're looking at the property info now, however dynamic properties don't have any. So that means that a dynamically created property $stream would've been overwritten before this patch but now no longer. So that is an unintended behaviour change.
|
Oh alright, I wasn't aware of this subtlety of dynamic properties. Let's refine that. |
|
Hmm so that would require to someone create the dynamic property in filter first and it could then be used in subsequent calls for stream, right? If so, that sounds like a proper edge case... :) |
|
The easiest way to test this is to create a onCreate method that sets a dynamic property on $this |
| Warning: fwrite(): Unprocessed filter buckets remaining on input brigade in %s on line %d | ||
| TypeError: Cannot assign resource to typed property | ||
|
|
||
| Fatal error: Uncaught TypeError: Cannot assign resource to property pass_filter::$stream of type int in %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused - the TypeError: Cannot assign resource to typed property presumably comes from the manual echo on line 29, so where does this uncaught fatal error come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also why is there a manual echo in the first place instead of echoing the value of getMessage() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworked the test file
2ad8c64 to
fe4961a
Compare
|
This will work, except for a pre-existing bug: It would also be great to try to avoid OBJPROP so that the property table isn't rebuilt, but that isn't critical. |
|
I tried to implement what you have in mind in 04e0955 |
22d1292 to
7208c60
Compare
7208c60 to
04e0955
Compare
Use
zend_update_property()instead of doing things "manually".