Skip to content

Commit e26b3e9

Browse files
committed
Revert GD changes
1 parent 209ee75 commit e26b3e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/gd/gd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,11 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
15631563
zend_string_release_ex(buff, 0);
15641564
}
15651565
/* try and force the stream to be FILE* */
1566-
else if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) {
1567-
goto out_err;
1566+
else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO)) {
1567+
/* try and force the stream to be FILE* */
1568+
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) {
1569+
goto out_err;
1570+
}
15681571
}
15691572

15701573
if (!im && fp) {

0 commit comments

Comments
 (0)