Skip to content

Fix php_pgsql_fd_cast() wrt. php_stream_can_cast() #6888

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

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Apr 20, 2021

php_stream_can_cast() forwards to _php_stream_cast() with ret set
to NULL. php_pgsql_fd_cast() needs to cater to that, because
otherwise the stream would report that it is not castable.

This might fix https://bugs.php.net/73903.


It seems not possible to write a meaningful regression test for this behavior, since the core and bundled extensions only use php_stream_can_cast() when checking for a TTY. It would, of course, be possible to use ext/zend_test, but that might be overkill.

`php_stream_can_cast()` forwards to `_php_stream_cast()` with `ret` set
to `NULL`.  `php_pgsql_fd_cast()` needs to cater to that, because
otherwise the stream would report that it is not castable.

This *might* fix https://bugs.php.net/73903.
@cmb69 cmb69 added the Bug label Apr 20, 2021
@cmb69 cmb69 closed this in 1fcea24 Apr 20, 2021
@cmb69 cmb69 deleted the cmb/pgsql-fd-can-cast branch April 20, 2021 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants