-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix bug for 77204 #4127
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
Fix bug for 77204 #4127
Conversation
|
This changes an This way we keep compatibility. We do similar things with other exposed functionality with |
|
@KalleZ Unless there is evidence that these functions see heavy use outside of php-src, changing the signature is fine for 7.4. |
|
Though I do wonder -- is there any way to get the file (or stream) name from the stream itself? |
|
@nikic I don't remember if there was a reliably way, but some streams may not expose a filename like a custom stream. For Now I do realize the userland function |
@KalleZ, thank you for your recommendation. It's fine to use the another function to do this without changing the Should I accept this request change? |
I just found that this |
|
@peter279k Can you find any other sources of usage of this function in PECL, Github or around the web just to give an idea if this is even remotely used? Thanks for your effort btw :) |
H @KalleZ, thank you for your reply. After using the But they're too old or seems to be unmaintained. The lists I found are as follows:
Some libraries are found in GitHub look old and inactive. I just present the captured shots to let us know that this function is available in |
|
Thank you for your research. In that case I guess its fine to change the signature for PHP's Stream API does not provide a reliable way to supply a file name unless its a standard I/O operation, in that case the caller may not have a file name to supply. Something as simple as checking if What do you think? cc @nikic |
Hi @KalleZ, thank you for your reply. Perhaps we can let the |
| /* }}} */ | ||
|
|
||
| static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ | ||
| static void php_getimagesize_from_stream(php_stream *stream, char *input, zval *info, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ |
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.
| static void php_getimagesize_from_stream(php_stream *stream, char *input, zval *info, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ | |
| static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ |
ext/standard/image.c
Outdated
| if ( !filetype) filetype = tmp; | ||
| if((php_stream_read(stream, filetype, 3)) != 3) { | ||
| php_error_docref(NULL, E_NOTICE, "Read error!"); | ||
| php_error_docref(NULL, E_NOTICE, "Read error from %s!", input); |
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.
| php_error_docref(NULL, E_NOTICE, "Read error from %s!", input); | |
| if (!input) { | |
| php_error_docref(NULL, E_NOTICE, "Read error!"); | |
| } else { | |
| php_error_docref(NULL, E_NOTICE, "Read error from %s!", input); | |
| } |
|
@KalleZ, I also add some suggested code snippets. Are the request changes that you expect :)? |
|
@kalle can you wrap this one up please ? |
|
To finalize this, here would be my suggestions:
|
|
@peter279k can we get a status update here please ? |
@krakjoe, thanks for your reply. I will do latest final changes that @nikic mentions. |
|
Thanks! Merged as 1ea329d into master, as we can't make ABI changes in 7.4 anymore. |

Changed log